Skip to content

rpeszek/crud-ex-backend-servant

Repository files navigation

Example backend CRUD project using Servant.
See my CRUD umbrella project: typesafe-web-polyglot.

Haskell

This (master) branch contains haskell implementation.

Eta

eta-jetty branch ports this code to eta-lang and runs in embedded jetty server.

Features

  • Servant Web API for my CRUD 'Thing' example.
  • Servant server implementation uses STM map as backend for simplicity. The data is lost when server is restarted.
  • API compiles to Elm. Code to do that is in api-to-elm folder (separate stack/cabal project, see separate README)

TODOs

  • resolve empty response incompatibility between generated Elm and Servant (haskell-servant/servant#69 ?)
  • compile Api to swagger
  • compile to a Haskell client
  • compile to other languages?
  • play more with Servant
  • play with persistence (something new and more than STM)

How to run

stack build 
stack exec crud-ex-backend-servant-exe

To run compiled Elm use: http://localhost:3000/elm
This will use servant served HTML page.

To run Elm in elm-reactor, clone crud-ex-frontend-elm)

Releases

No releases published

Packages

No packages published