Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subdomains in Play 2.0

Is it possible work with subdomains in Play 2.0 conf/routes? Like Play 1.1:

GET    {client}.mysoftware.com/         Application.index

How I can work with subdomains in my Play 2.0 app?

like image 887
Timothy Klim Avatar asked Jan 16 '23 10:01

Timothy Klim


2 Answers

The subdomain configuration is not done at the Play level, but at the reverse proxy level.

like image 137
Julien Richard-Foy Avatar answered Jan 21 '23 12:01

Julien Richard-Foy


Unfortunately not.

Here's the definition of a route:

case class Route(verb: HttpVerb, path: PathPattern, call: HandlerCall) extends Positional

It accepts the verb (e.g. GET), the path component (i.e. not the domain or port, but only the path component) and the handler.

The definition of PathPattern can be found here, and as far as I can see, it doesn't cater for domain nor port.

like image 24
opyate Avatar answered Jan 21 '23 12:01

opyate