-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
57 lines (48 loc) · 1.29 KB
/
index.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Created by PhpStorm.
* User: AMAN
* Date: 12/30/2015
* Time: 9:29 PM
*/
date_default_timezone_set('UTC');
error_reporting(-1);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
/** Loading Plugins */
require 'vendor/autoload.php';
/**
* Step 2: Instantiate a Slim application
*
* This example instantiates a Slim application using
* its default settings. However, you will usually configure
* your Slim application now by passing an associative array
* of setting names and values into the application constructor.
*/
$app = new \Slim\Slim(array(
'debug' => true
));
require_once('config.php');
/**
* Step 3: Define the Slim application routes
*
* Here we define several Slim application routes that respond
* to appropriate HTTP request methods. In this example, the second
* argument for `Slim::get`, `Slim::post`, `Slim::put`, `Slim::patch`, and `Slim::delete`
* is an anonymous function.
*/
$app->get(
'/',
function () {
$template = '{"Welocme to ":"Test Demo for Slim Api Rest formats"}';
echo $template;
}
);
include("api/student.php");
/**
* Step 4: Run the Slim application
*
* This method should be called last. This executes the Slim application
* and returns the HTTP response to the HTTP client.
*/
$app->run();