riverside / php-express

:horse: PHP micro-framework inspired by Express.js
https://riverside.github.io/php-express/
MIT License
28 stars 11 forks source link

Not Found Error on All routes excpet "/" #2

Closed cstayyab closed 4 years ago

cstayyab commented 4 years ago

It is giving not found error on all pages except "/" route. And I have tested it on basic example. Nothing Complex.

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . "/vendor/autoload.php";
use \PhpExpress\Application;

$app = new Application();

$app->get("/", function ($req, $res) {
    $res->send("Root");
});

$app->get("/test", function ($req, $res) {
    $res->send("Test");
});

$app->run();

PHP Version: 7.4

riverside commented 4 years ago

Remove the slash in front of "test", e.g. $app->get("test", ...

This is shown in the examples.

Meleeman01 commented 2 years ago

i'm also having this problem as well i can't get teh example 02-routes to work on php dev server https://github.com/riverside/php-express/blob/master/examples/02-views/index.php i'm using php 7.3