Created
January 17, 2011 22:15
-
-
Save wfaler/783603 to your computer and use it in GitHub Desktop.
MyController.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyController extends Controller{ | |
// responds to GET requests at /widgets/ | |
get("/widgets/")((request, response) => { | |
..code goes here.. | |
}) | |
// responds to GET requests at /widgets/[someId], where | |
// ":id" will be mapped to a named request parameter "id" | |
get("/widgets/:id")((request, response) => { | |
..code goes here.. | |
}) | |
// responds to POST requests at /widgets/[someId], where | |
// ":id" will be mapped to a named request parameter "id" | |
post("/widgets/:id")((request, response) => { | |
..code goes here.. | |
}) | |
// responds to PUT requests at /widgets/[someId], where | |
// ":id" will be mapped to a named request parameter "id" | |
put("/widgets/:id")((request, response) => { | |
..code goes here.. | |
}) | |
// responds to DELETE requests at /widgets/[someId], where | |
// ":id" will be mapped to a named request parameter "id" | |
delete("/widgets/:id")((request, response) => { | |
..code goes here.. | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment