因此,我在 Heroku 上部署了 Slim 应用程序。只有索引路由 (/) 有效,对于其他路由,我收到 404 未找到错误。
这是我的routes.php 文件
// index
$app->group('', function(RouteCollectorProxy $group) {
$group->get('/', EntryPointController::class . ':index' );
$group->get('/test', EntryPointController::class . ':test' );
});
// api
$app->group('/api/v1', function(RouteCollectorProxy $group) {
$group->get('/products', ProductsController::class . ':all' );
});
概要文件内容:
web: vendor/bin/heroku-php-apache2 public/
对于除索引路由 (/) 之外的所有路由,我收到 404 错误,尽管在 localhost 上一切正常。
那么请问,这个问题该如何解决呢?
守着星空守着你