Skip to content

Instantly share code, notes, and snippets.

@turbo
Created October 18, 2019 19:34
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 turbo/8641ea86d62ecdac61e13f23621072c4 to your computer and use it in GitHub Desktop.
Save turbo/8641ea86d62ecdac61e13f23621072c4 to your computer and use it in GitHub Desktop.
(let [app (turbo.web.Application:new [
; No arguments, will work for 'localhost:8888' and 'localhost:8888/'
["/$" IndexHandler]
; Use the part of the url after /user/ as the first argument to
; UserHandler:get
["/user/(.*)$" UserHandler]
; Find two int's separated by a '/' after /add in the url
; and pass them as arguments to AddHandler:get
["/add/(%d+)/(%d+)$" AddHandler]
])]
(app:listen 8888)
(: (turbo.ioloop.instance) :start))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment