Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tmcgilchrist/airship
Helium + Webmachine = Airship. A toolkit for building declarative, RESTful web apps.
https://github.com/tmcgilchrist/airship
github-actions haskell webmachine
Last synced: 1 day ago
JSON representation
Helium + Webmachine = Airship. A toolkit for building declarative, RESTful web apps.
- Host: GitHub
- URL: https://github.com/tmcgilchrist/airship
- Owner: tmcgilchrist
- Created: 2015-01-23T22:30:51.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T14:00:13.000Z (almost 2 years ago)
- Last Synced: 2024-12-16T02:56:37.206Z (6 days ago)
- Topics: github-actions, haskell, webmachine
- Language: Haskell
- Homepage: http://tmcgilchrist.github.io/airship/
- Size: 330 KB
- Stars: 244
- Watchers: 37
- Forks: 14
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Airship
[![GitHub CI][github-shield]][github-ci] [![docs][docs-shield]][docs]
Airship is a Haskell library for handling and serving HTTP requests in a RESTful fashion. It is heavily inspired by [Webmachine](https://github.com/basho/webmachine)
and works with any [WAI](https://hackage.haskell.org/package/wai)-compatible web server such as [Warp](https://hackage.haskell.org/package/warp).It aims to be small, fast, and flexible.
# How does it work?
Airship resources are represented with a [`Resource` record type](https://github.com/tmcgilchrist/airship/blob/master/airship/src/Airship/Resource.hs#L39-L117).
Each field in `Resource` corresponds to an action taken in the [Webmachine decision tree](https://raw.githubusercontent.com/wiki/Webmachine/webmachine/images/http-headers-status-v3.png).
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:
```haskell
routes = do
root #> someRootResource
"account" > var "name" #> accountResource
```For a simple example that handles HTTP GET and POST requests, please check [`example/Basic.hs`](https://github.com/tmcgilchrist/airship/blob/master/example/Basic.hs).
For a slightly more involved example that generates HTML and manages a pool of resources, please check the [blimp](https://github.com/patrickt/blimp) repository.Airship is copyright © 2015 Helium Systems, Inc., and released to the public under the terms of the MIT license.
[github-shield]: https://github.com/tmcgilchrist/airship/actions/workflows/ci.yaml/badge.svg
[github-ci]: https://github.com/tmcgilchrist/airship/actions/workflows/ci.yaml[docs-shield]:https://img.shields.io/badge/doc-online-blue.svg
[docs]: https://tmcgilchrist.github.io/airship/index.html