-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
26 lines (21 loc) · 691 Bytes
/
Copy pathindex.php
File metadata and controls
26 lines (21 loc) · 691 Bytes
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
<?php
use Remcodex\Server\Command;
use Remcodex\Server\ErrorHandler;
use Remcodex\Server\Prebuilt\RequestListener;
use Remcodex\Server\Prebuilt\ResponseListener;
use Remcodex\Server\Router;
use Remcodex\Server\Server;
require 'vendor/autoload.php';
//Load http routes
$collector = Router::load(__DIR__ . '/routes.php');
//Load request commands
$commands = Command::load(__DIR__ . '/commands.php');
//Create and start server
Server::create()
->setEnvironment(Server::ENV_DEVELOPMENT)
->setErrorHandler(new ErrorHandler())
->setRouteCollector($collector)
->setCommands($commands)
->onRequest(new RequestListener())
->onResponse(new ResponseListener())
->run();