You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.
I encountered this behavior while following the official documentation.
I added a second emit to verify it.
The first visit returns the route properly, at the second attempt it bypasses all other Routes and triggers the first Swoole\emit it encounters so in my case it returns 'Hello World' rather than 'Not Found'.
index.php:
<?php declare(strict_types=1);
require_once 'vendor/autoload.php';
use Siler\Swoole;
use Siler\Route;
use Siler\Twig;
Twig\init('pages');
$handler = function ($req) {
Route\get('/', 'pages/home.php');
Route\get('/todos', 'api/todos.php');
Swoole\emit('Hello World');
Swoole\emit('Not found', 404);
};
Swoole\http($handler)->start();
pages/home.php
<?php declare(strict_types=1);
use Siler\Swoole;
use Siler\Twig;
return fn() => Swoole\emit(Twig\render('home.twig'));
Hello @leocavalcante
Thank you for Siler.
There's this strange issue with v1.7.9
API returns 'Not Found' after first request with Siler Swoole
This worked fine up to version 1.7.8
Simple code to recreate
index.php
Then, api/get.php
Request API more than once. You would see the "Not Found"
The text was updated successfully, but these errors were encountered: