-
Notifications
You must be signed in to change notification settings - Fork 0
/
final.php
32 lines (27 loc) · 853 Bytes
/
final.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/*
scott campbell
Kurt Johnson
display temps
*/
$DBSTRING = "sqlite:cse383.db"; // This must be updated to your real database location
include "sql.inc";
include "final.class.php";
header ("Access-Control-Allow-Origin: *");
header ("Access-Control-Allow-Methods: GET,POST,PUSH,OPTIONS");
header ("content-type: application/json");
header ("Access-Control-Allow-Headers: Content-Type");
require_once "RestServer.php";
// phpinfo();
// Kurt Johnson
// with linux function code by Scott Campbell
// $method=$_REQUEST["method"];
// example request: http://path/to/resource/rest/api/vi/sayHello?&name=World
//
//
// example request: http://path/final.php/sayHello?&name=World
// method="sayHello"
$method=str_replace("/","",$_SERVER["PATH_INFO"]);
$METHOD=$method;
$rest = new RestServer (new final_rest(),$method);
$rest->handle ();