summaryrefslogtreecommitdiff
path: root/example/variableRoutes/app/src/VariableRoutes.scala
blob: a1c8a4fef57959d21e1dbd678f1552fd767c058c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package app
object VariableRoutes extends cask.MainRoutes{
  @cask.get("/user/:userName")
  def showUserProfile(userName: String) = {
    s"User $userName"
  }

  @cask.get("/post/:postId")
  def showPost(postId: Int, param: Seq[String]) = {
    s"Post $postId $param"
  }

  @cask.get("/path", subpath = true)
  def showSubpath(request: cask.Request) = {
    s"Subpath ${request.remainingPathSegments}"
  }

  initialize()
}