Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahashi-h5/468e2879666e15247f33a9f818c9eb52 to your computer and use it in GitHub Desktop.
Save takahashi-h5/468e2879666e15247f33a9f818c9eb52 to your computer and use it in GitHub Desktop.
<?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