Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

jml/servant-template

Repository files navigation

servant-template

Circle CI

A cookiecutter template for (almost) production-ready Servant servers.

My goal is to reduce friction for people starting working on Haskell REST API servers by putting together a few best practices in a way that's not intrusive or prescriptive.

Usage

$ pip install --user cookiecutter
$ cookiecutter gh:jml/servant-template

Once the template is created, you can build things with stack or use the provided Makefile.

Your API definition goes in the YourApp.API module and the application logic in the YourApp.Server.Handlers module.

Features

Things you get with this template:

Choices

This cookiecutter project makes a few opinionated decisions:

  • GHC 8.0 only
  • Built with Stack
  • Uses package.yaml (from hpack) to configure dependencies etc.
  • Protolude as the Prelude
  • The root page of the service has a simple HTML page intended for use by developers
  • There is only one executable: the binary that launches the server
  • The hackage name is the repo name is the project name is the executable name
  • Uses CircleCI as its default CI tool
  • Enforces hindent-formatted code in CI
  • The code that defines the API is in a separate library to the code that implements it

Many of these opinions are lightly held. If this template would be more useful to you with some of them changed, please file an issue or submit a PR.

Notes

Note that the Cabal file is not checked in to this cookiecutter template.

Uses Johan Tibbe's style guide, enforced by hindent

You can build a Docker image with make image.

About

Cookiecutter template for Servant projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages