【发布时间】:2020-02-11 08:25:03
【问题描述】:
我有一个提供 SPA 的 Play Framework 应用程序。路由文件包含以下路由:
GET / controllers.Home.index
GET /index.html controllers.Home.index
# /api/* routes
GET /*file controllers.Assets.at(file)
controllers.Home.index 在执行 SSO 例程后提供 SPA 的索引。
当我在没有任何额外配置的情况下运行应用程序时,在访问 localhost:3000 和 localhost:3000/ 时,Home 控制器中的 index 操作会按预期调用。
问题从我配置play.http.context开始:
- 设置为
/my-app时,对localhost:3000/my-app的请求成功;到localhost:3000/my-app/返回 404。 - 设置为
/my-app/时,对localhost:3000/my-app的请求返回404;到localhost:3000/my-app/成功。
有没有办法配置 Play 以使对两个 URL 的请求都以controllers.Home.index 成功?
【问题讨论】:
标签: scala playframework