【发布时间】:2015-09-25 20:12:20
【问题描述】:
我正在使用 Slim Framework 编写 API,但遇到 404 错误
require ('Slim/Slim/Slim.php');
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();
$app->response()->header('Content-Type', 'application/json;charset=utf-8');
$app->get('/', 'test'); // It is OK and I can see the return of my function "test" when I access domain/api
$app->get('/groups', 'getGroups'); // 404 error while I try to go to domain/api/groups
有人知道如何解决这个路线问题吗?
【问题讨论】:
-
您的问题解决了吗?我更新了我的答案以真正回答您的问题..
-
是的,谢谢,我想为您的答案投票,但我没有这样做的声誉。对不起=/
-
你可以接受我的回答 - 在这里描述:meta.stackexchange.com/a/5235
标签: frameworks routes http-status-code-404 slim