Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module WebInterface
- using Morsel
- app = Morsel.app()
- using Debug
- import JSON
- route(app, GET | POST | PUT, "/") do req, res
- if haskey(req.state, :url_params)
- return JSON.json(req.state[:url_params])
- else
- return ""
- end
- end
- get(app, "/about") do req, res
- "This app is running on Morsel"
- end
- start(app, 8000)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement