我希望静态资源位于http://127.0.0.1:8300/static/app.js
等网址中,并存储在我的应用程序中的./static
中。
我已将文件放入./static/app.js
并添加到./conf/routes
:
# Map static resources from the ./static folder to the /static URL path
GET /static/*file controllers.Assets.at(path="/static", file)
Hovever当我在http://127.0.0.1:8300/static/app.js
上发出GET请求时,收到错误消息:
Action Not Found
For request 'GET /static/app.js'
These routes have been tried, in this order:
GET/ controllers.HomeController.index
GET/count controllers.CountController.count
GET/message controllers.AsyncController.message
GET/assets/$file<.+> controllers.Assets.versioned(path:String = "/public", file:Asset)
GET/static/$file<.+> controllers.Assets.at(path:String = "/static", file:String)
GET/users controllers.UserController.users
任何人都知道为什么它不匹配GET/assets/$file<.+>
?
我当然可以将我的资产放在./public/
作为解决方法,但我想知道为什么我不能将它们放在./static/