Notice: You probably want Matt Bray's servant-elm instead of this one
If you've described a REST API with servant, this package can generate an Elm module for communicating with that API.
This is currently a scrappy work in progress created in the course
of our monthly Hack Days at work. We're using the not-yet-released
servant-foreign
library, so we can't ship servant-elm
yet. Check
out the
milestones for
more info about what works and what doesn't.
Once published, you'll be able to install this from Hackage with cabal
or stack
.
To work on it locally, check out this repo, then stack build
should
build the example app.
There's an example API and server defined in example/Main.hs
, which
dumps an Elm module to a named file before starting to serve the API:
stack exec servant-elm-example example-elm/API.elm
Run elm-reactor
and open example-elm/Example.elm
to connect to the
API server from Elm using the generated bindings.
TODO
This software was written by Andy Newport, Steve Purcell and Kieran Trezona-le Comte with the support of our awesome employer Powershop, who have other cool stuff here on Github.
Copyright Powershop NZ Ltd. BSD3 license.