簡體   English   中英

如何指定Play框架以使用其他路徑文件

[英]How do I specify the Play Framework to use a different route file

我知道我可以通過使用-Dconfig.file標志使Play服務器使用不同的application.conf文件。

有沒有辦法指定服務器使用不同的路由文件?

您可以在application.conf中設置它或使用JVM標志

-Dapplication.router=my.application.Routes

https://github.com/playframework/playframework/blob/2.2.1/framework/skeletons/java-skel/conf/application.conf#L20

# Router
# ~~~~~
# Define the Router object to use for this application.
# This router will be looked up first when the application is starting up,
# so make sure this is the entry point.
# Furthermore, it's assumed your route file is named properly.
# So for an application router like `conf/my.application.Router`,
# you may need to define a router file `my.application.routes`.
# Default to Routes in the root package (and `conf/routes`)
# application.router=my.application.Routes

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM