A simple template for getting started on Haskell web development. This provides a bare-bones reading tracking app to show how you can serve web pages and REST APIs in Haskell.
This can be used to get started with JSON API webservices, client-facing HTML web apps, or both.
- http routing with scotty
- HTML5 rendering/templates with blaze-html
- Static file serving
- JSON REST API using aeson
- CORS enabled
- Postgres database connection using postgresql-simple
- App building and serving with Cabal
- VSCode integration/intellisense with the Haskell Extension
demo.mp4
Edit the Postgres connection info in app/Main.hs
localPG :: ConnectInfo
localPG =
defaultConnectInfo
{ connectDatabase = "postgres",
connectHost = "localhost",
connectPassword = "1234"
}
Then run the app using cabal
$ cabal run