-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
42 lines (21 loc) · 1.06 KB
/
index.php
File metadata and controls
42 lines (21 loc) · 1.06 KB
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
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once "vendor/autoload.php";
use Simp\Router\Route;
require_once "Example.php";
require_once "Help.php";
require_once "ExampleMiddleware.php";
// Make the middleware_register_file where you can declare middlewares.
$middleware_register_file = __DIR__ . '/middleware.yml';
$route = new Route($middleware_register_file);
$route->get("/","index",Example::class);
$route->get("/api/help-document/[help_title:".Help::class."]","api_help",Example::class . "@help");
$route->get("/api/posts","posts",Example::class . "@posts");
$route->get("/api/post/[id:int]","post",Example::class. "@post");
$route->post("/api/post","post_create",Example::class . "@post_create");
$route->delete("/api/post/[id:int]","post_delete",Example::class . "@post_delete");
$route->put("/api/post/[id:int]","post_update",Example::class);
$route->get("/api/posts/search/[title]","post_search",Example::class);
$route->get("/api/post/[id:int]/image","post_image",Example::class);
$route->send(\GuzzleHttp\Psr7\Response::class);