Question

Play Framework has the file routes. This file list all the routes needed by the application. By default, the route file has a line:

# Catch all
*       /{controller}/{action}                  {controller}.{action}

How to safely use it in production mode? Do I need to comment this line out?

Was it helpful?

Solution

Yes, ideally you should comment it in production. In fact I would comment it in development too, that way you'll notice any missing route.

OTHER TIPS

If you still want to use it in dev (for faster development, nice error messages, ...), this is how you do it:

#{if play.mode.isDev()}
  *   /{controller}/{action}      {controller}.{action}
#{/if}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top