首页 > 解决方案 > URL 中未指定路径时默认为 index.html

问题描述

我正在使用 Play Framework 2.8。

我将路线设置为:

GET  /*file     controllers.Assets.at(path="/public", file="index.html")

或者:

GET  /    controllers.Assets.at(path="/public", file="index.html")

index.html如果没有指定路径,它们似乎都没有默认为。

路由中是否有默认xxx.test.com设置xxx.test.com/index.html

标签: scalaplayframeworkroutes

解决方案


找到了答案。我有这些错误的顺序 GET / controllers.Assets.at(path="/public", file="index.html") GET /*file controllers.Assets.at(path="/public", file)

将 */file 作为第一个更改它们的方法,就像我解决了这个问题一样。

谢谢你们。


推荐阅读