Skip to content

Instantly share code, notes, and snippets.

@ryangjchandler
Created May 14, 2020 22:49
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 ryangjchandler/6b61bc386dd75b1b77dc2854bd4a3c6e to your computer and use it in GitHub Desktop.
Save ryangjchandler/6b61bc386dd75b1b77dc2854bd4a3c6e to your computer and use it in GitHub Desktop.
// module name shoild follow folders, like PSR-4
module controllers
import "http" exposing Request, Response
export class HelloController {
exposed function handle(req Request, res Response) {
return res.send("Hello")
}
}
import "http" exposing HttpServer, Request, Response
import "controllers" as c
function main() {
HttpServer.get("/", c.HelloController.handle)
HttpServer.listen(8080)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment