Skip to content

Instantly share code, notes, and snippets.

// 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")
}
// 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
function main() {
HttpServer.get("/", func (req Request, res Response) => {
return res.Send("Hello!")
})
HttpServer.listen(8080)
}