Skip to content

Instantly share code, notes, and snippets.

@Pajn
Created May 25, 2014 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pajn/83597827d5c80c4fcbe9 to your computer and use it in GitHub Desktop.
Save Pajn/83597827d5c80c4fcbe9 to your computer and use it in GitHub Desktop.
new RestServer()
..clientRoutes = ['/page']
..static(STATIC_PATH, jailRoot: false)
..route(new Route('/api/auth')
..post = authorization.register
..put = authorization.login)
..preprocessor(authorization.checkLogin)
..route(new Route('/api/checkAuth')
..get = authorization.success)
..route(new Route('/api/page/{id}')
..get = page.serve
..put = page.save)
..start(address: address, port: port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment