You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
990 B

8 years ago
8 years ago
  1. <?php
  2. chdir('..');
  3. include('vendor/autoload.php');
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpFoundation\Response;
  6. $router = new League\Route\RouteCollection;
  7. $templates = new League\Plates\Engine(dirname(__FILE__).'/../views');
  8. $router->addRoute('GET', '/', 'Controller::index');
  9. $router->addRoute('GET', '/dashboard', 'Controller::dashboard');
  10. $router->addRoute('GET', '/api', 'Controller::api');
  11. $router->addRoute('POST', '/webmention', 'API::webmention');
  12. $router->addRoute('GET', '/webmention/{code}', 'API::webmention_status');
  13. $router->addRoute('GET', '/login', 'Auth::login');
  14. $router->addRoute('GET', '/logout', 'Auth::logout');
  15. $router->addRoute('POST', '/login/start', 'Auth::login_start');
  16. $router->addRoute('GET', '/login/callback', 'Auth::login_callback');
  17. $dispatcher = $router->getDispatcher();
  18. $request = Request::createFromGlobals();
  19. $response = $dispatcher->dispatch($request->getMethod(), $request->getPathInfo());
  20. $response->send();