diff options
Diffstat (limited to 'cask/test')
-rw-r--r-- | cask/test/src/test/cask/CaskTest.scala | 8 | ||||
-rw-r--r-- | cask/test/src/test/cask/HelloWorld.scala | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/cask/test/src/test/cask/CaskTest.scala b/cask/test/src/test/cask/CaskTest.scala index 9a0876d..01c905a 100644 --- a/cask/test/src/test/cask/CaskTest.scala +++ b/cask/test/src/test/cask/CaskTest.scala @@ -1,19 +1,17 @@ package test.cask object MyServer extends cask.Routes{ - - - @cask.route("/user/:userName") + @cask.get("/user/:userName") def showUserProfile(userName: String) = { s"User $userName" } - @cask.route("/post/:postId") + @cask.post("/post/:postId") def showPost(postId: Int, query: String) = { s"Post $postId $query" } - @cask.route("/path/::subPath") + @cask.put("/path/::subPath") def showSubpath(subPath: String) = { s"Subpath $subPath" } diff --git a/cask/test/src/test/cask/HelloWorld.scala b/cask/test/src/test/cask/HelloWorld.scala new file mode 100644 index 0000000..69a4370 --- /dev/null +++ b/cask/test/src/test/cask/HelloWorld.scala @@ -0,0 +1,12 @@ +package test.cask + +object HelloRoutes extends cask.Routes{ + @cask.get("/") + def hello() = { + "Hello World!" + } + + initialize() +} + +object HelloWorld extends cask.Main(HelloRoutes) |