scala - 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
?
解决方案
找到了答案。我有这些错误的顺序 GET / controllers.Assets.at(path="/public", file="index.html") GET /*file controllers.Assets.at(path="/public", file)
将 */file 作为第一个更改它们的方法,就像我解决了这个问题一样。
谢谢你们。
推荐阅读
- mysql - MYSQL JSON 按值排序
- java - Spring休眠配置之谜
- java - encodeBase64 和 decodeBase64 不可见
- r - 如何在网格中按颜色缩放点值 - RStudio
- angular - 在后端(Python FastAPI)、前端(Angular)框架中使用 HTTPS
- node.js - 在 VSCode 扩展中,如何使用 cmd.exe 打开终端?
- python-3.x - 使用硒单击 Instagram 页面中的项目时遇到问题
- angular - 在模式而不是新窗口中显示 CKEDITOR 预览
- grails - 使用来自 grails 4.0.3 中的 rabbit mq 消费者的数据在服务层中保存数据库中的记录时出现问题
- aws-lambda - CDK 本地测试,无服务器