synthetic
synthetic

Reputation: 908

Scala Play 2.8 Framework: Splitting the route file, prefix contains a dynamic part

I am having trouble spritting the routes file, as a prefix contains a dynamic part. Can I do smth about it?

routes:

->  /admin/:hash/v1 admin.Routes

admin.routes

GET /users controller.ManageUsers(hash: String)

Autogenerated code looks like:

private[this] val prefixed_admin_Routes_0_416 = Include(admin_Routes_0.withPrefix(this.prefix + (if (this.prefix.endsWith("/")) "" else "/") + "admin/$hash<[^/]+>/v1"))

I am ok to even drop that :hash part, without propagating to the controller, but it's a dynamic part in the url.

Upvotes: 1

Views: 191

Answers (1)

synthetic
synthetic

Reputation: 908

I kind of solved it with not having a prefix in the main route:

routes:

->  / admin.Routes

admin.routes

GET /admin/:hash/v1/users controller.ManageUsers(hash: String)

Upvotes: 0

Related Questions