Created
May 14, 2020 22:49
-
-
Save ryangjchandler/6b61bc386dd75b1b77dc2854bd4a3c6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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