willy.club/routes/start.php

28 lines
571 B
PHP

<?php
use App\Config;
use WillySoft\ErrorHandler;
use WillySoft\Route as App;
Config::file_location(
__DIR__ . '/../config/default.config.php',
__DIR__ . '/../config/config.php'
);
ErrorHandler::register(function($error_message) {
view('errors/500', [
'error_message' => $error_message
]);
});
use App\Controller\DefaultController;
App::get('/',
DefaultController::index(...));
App::get('/echo/$text?',
DefaultController::echo(...));
App::get('/error',
DefaultController::error(...));
http_response_code(404);
view('errors/404');