Created
February 3, 2014 07:23
-
-
Save benkolera/8779969 to your computer and use it in GitHub Desktop.
This file contains 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
def intent = { | |
case req @ GET(Path(Seg("admin" :: "accounts" :: rest ))) => req match { | |
case Session(session) if (session.get("username").nonEmpty) => Pass | |
case _ => req.respond(Unauthorized) | |
} | |
case req @ GET(Path(Seg("admin" :: "accounts" :: Nil))) => | |
list(req) | |
case req @ GET(Path(Seg("admin" :: "accounts" :: "uncreated" :: Nil))) => | |
uncreated(req) | |
case req @ GET(Path(Seg("admin" :: "accounts" :: id :: Nil))) => | |
get(req, id) | |
case req @ POST(Path(Seg("admin" :: "accounts" :: id :: "create" :: Nil))) => | |
create(req, id) | |
case req @ POST(Path(Seg("admin" :: "accounts" :: id :: "update" :: Nil))) => | |
update(req, id) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment