Advertisement
Guest User

Untitled

a guest
May 6th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. module WebInterface
  2.  
  3. using Morsel
  4.  
  5. app = Morsel.app()
  6.  
  7. using Debug
  8. import JSON
  9.  
  10. route(app, GET | POST | PUT, "/") do req, res
  11. if haskey(req.state, :url_params)
  12. return JSON.json(req.state[:url_params])
  13. else
  14. return ""
  15. end
  16. end
  17.  
  18. get(app, "/about") do req, res
  19. "This app is running on Morsel"
  20. end
  21.  
  22. start(app, 8000)
  23.  
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement