We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

[Solved] Micro Api Not Working?

Please help Im a newbie in micro applications and not find errror in my script.

Look at this code:


use Phalcon\DI\FactoryDefault,
    Phalcon\Mvc\Micro,
    Phalcon\Mvc\Micro\Collection as MicroCollection,
    Phalcon\Events\Manager as EventsManager;

$di = new FactoryDefault();
$config = include __DIR__ . '/../config/config.php';

error_reporting(-1);
ini_set('display_errors', TRUE);

include __DIR__ . '/../controllers/GeoPointsController.php';

$app = new Micro();
$app->setDI($di);

/*API*/

$apiHandler = new MicroCollection();
$apiHandler->setHandler('GeoPointsController', TRUE);
$apiHandler->setPrefix('/geo');
$apiHandler->get('/', 'index');

$app->mount($apiHandler);

$app->notFound(function () use ($app) {
    $app->response->setStatusCode(404, "Not Found")->sendHeaders();
    echo 'This is crazy, but this page was not found!';
});

$app->handle();

when I /geo and /geo it shows

This is crazy, but this page was not found!

My Error in htaccess rewrite



98.9k

what it was?