Skip to content

Instantly share code, notes, and snippets.

@ryangjchandler
Created May 14, 2020 22:49
Show Gist options
  • Save ryangjchandler/76d06009018489636b74c2869b7caa4e to your computer and use it in GitHub Desktop.
Save ryangjchandler/76d06009018489636b74c2869b7caa4e 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