airship

A Webmachine-inspired HTTP library

https://github.com/helium/airship/

Version on this page:0.9.2
LTS Haskell 20.26:0.9.5
Stackage Nightly 2022-11-17:0.9.5
Latest on Hackage:0.9.5

See all snapshots airship appears in

MIT licensed by Reid Draper and Patrick Thomson
This version can be pinned in stack with:airship-0.9.2@sha256:46d13dc9e38d3d5c03bc964d5c2c30e86ea096e16f56ec938438e6f019187444,3961

Airship

Join the chat at https://gitter.im/helium/airship

Build Status

Airship is a Haskell library for handling and serving HTTP requests in a RESTful fashion. It is heavily inspired by Webmachine and works with any WAI-compatible web server such as Warp. It aims to be small, fast, and flexible.

How does it work?

Airship resources are represented with a Resource record type. Each field in Resource corresponds to an action taken in the Webmachine decision tree. Airship provides a defaultResource with sensible defaults for each of these actions; you build web services by overriding fields in the default resource with your own.

Routes are declared with a simple monadic syntax:

routes = do
    root                        #> someRootResource
    "account" </> var "name"    #> accountResource

For a simple example that handles HTTP GET and POST requests, please check example/Basic.hs. For a slightly more involved example that generates HTML and manages a pool of resources, please check the blimp repository.

Airship is copyright © 2015 Helium Systems, Inc., and released to the public under the terms of the MIT license.

Changes

  • 0.9.0
  • Handle unspecified content-type (#107)
  • Unroll internal webmachine monad (#108)
  • Support for GHC 8.2.1
  • Various bugfixes