Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pattern /articles/:id.:format #2

Open
ngocdaothanh opened this issue Oct 20, 2014 · 2 comments
Open

Support pattern /articles/:id.:format #2

ngocdaothanh opened this issue Oct 20, 2014 · 2 comments

Comments

@ngocdaothanh
Copy link
Member

"A router" should "handle dots" in {
  val router = new Router[String]
  router.pattern("/articles/:id",         "show")
  router.pattern("/articles/:id.:format", "show")

  val routed1 = router.route("/articles/123")
  routed1.target           should be ("show")
  routed1.params.size      should be (1)
  routed1.params.get("id") should be ("123")

  val routed2 = router.route("/articles/123.json")
  routed2.target               should be ("show")
  routed2.params.size          should be (2)
  routed2.params.get("id")     should be ("123")
  routed2.params.get("format") should be ("json")
}
@matiwinnetou
Copy link

+1

@matiwinnetou
Copy link

I though this is a glitch on my side but actually perhaps there is more general pattern here.

At the moment it seems this is not possible to handle variables inside strings:

.GET("/{:segment}-inserat/:seo-part/{:adId}.html", vipHandler)

Ideally for me I am only interested in segment and adId as variables not other strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants