2
我知道我可以通過使用-Dconfig.file標誌使Play服務器使用不同的application.conf文件。如何指定Play Framework使用不同的路由文件
有什麼辦法可以指定服務器使用不同的路由文件嗎?
我知道我可以通過使用-Dconfig.file標誌使Play服務器使用不同的application.conf文件。如何指定Play Framework使用不同的路由文件
有什麼辦法可以指定服務器使用不同的路由文件嗎?
您可以設置它在你的application.conf或使用JVM標誌
-Dapplication.router=my.application.Routes
# 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
路由文件可以包含另一條路線的文件,就像application.conf可以嗎? – zzhang
是的一個真實生活的例子是在https://github.com/beligum中看到http://www.playframework.com/documentation/2.2.x/SBTSubProjects「拆分路線文件」。 – Schleichardt