Created
March 20, 2020 04:55
-
-
Save takahashi-h5/468e2879666e15247f33a9f818c9eb52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use Phalcon\Di\FactoryDefault; | |
use Phalcon\Mvc\Micro; | |
error_reporting(E_ALL); | |
define('BASE_PATH', dirname(__DIR__)); | |
define('APP_PATH', BASE_PATH . '/app'); | |
try { | |
$di = new FactoryDefault(); | |
include APP_PATH . '/config/router.php'; | |
include APP_PATH . '/config/services.php'; | |
$config = $di->getConfig(); | |
include APP_PATH . '/config/loader.php'; | |
// add start | |
$app = new Micro(); | |
$app->get( | |
'/api/robots', | |
function () { | |
// 実装 | |
} | |
); | |
$app->handle( | |
$_SERVER["REQUEST_URI"] | |
); | |
// add end | |
} catch (\Exception $e) { | |
echo $e->getMessage() . '<br>'; | |
echo '<pre>' . $e->getTraceAsString() . '</pre>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment