2017-05-25 19:12:29 +00:00
# HTTPure
2017-07-10 19:38:56 +00:00
[![License ](https://img.shields.io/badge/license-MIT-blue.svg )](https://raw.githubusercontent.com/cprussin/purescript-httpure/master/License)
[![Latest release ](http://img.shields.io/github/release/cprussin/purescript-httpure.svg )](https://github.com/cprussin/purescript-httpure/releases)
[![Build Status ](https://travis-ci.org/cprussin/purescript-httpure.svg?branch=master )](https://travis-ci.org/cprussin/purescript-httpure)
2017-07-21 06:26:13 +00:00
[![purescript-httpure on Pursuit ](https://pursuit.purescript.org/packages/purescript-httpure/badge )](https://pursuit.purescript.org/packages/purescript-httpure)
2017-07-10 19:38:56 +00:00
2017-05-25 19:12:29 +00:00
A purescript HTTP server framework.
2017-09-26 14:47:05 +00:00
HTTPure is:
- Well-tested (see our [tests ](./test ))
- Well-documented (see our [documentation ](./docs ))
- Built to take advantage of PureScript language features for flexible and
extensible routing
- Pure (no `set` , `get` , `use` , etc)
2017-05-25 19:12:29 +00:00
## Status
2017-09-26 14:47:05 +00:00
This project is currently fairly stable, but has not reached it's 1.0 release
yet. You can track what's left before it gets there by looking at our
[roadmap ](https://github.com/cprussin/purescript-httpure/projects ). The API
signatures are _mostly_ stable, but are subject to change before the 1.0 release
if there's a good reason to change them.
If you'd like to help us get to 1.0 quicker, please contribute! To get started,
check our [contributing guide ](Contributing.md ).
2017-05-25 19:12:29 +00:00
## Installation
```bash
2017-05-26 03:04:56 +00:00
bower install --save purescript-httpure
2017-05-25 19:12:29 +00:00
```
2017-07-10 10:17:13 +00:00
## Quick Start
```purescript
module Main where
2017-09-26 14:47:05 +00:00
import Prelude (($))
2017-07-10 10:17:13 +00:00
import Control.Monad.Eff.Console as Console
import HTTPure as HTTPure
2017-07-14 06:43:20 +00:00
main :: HTTPure.ServerM (console :: Console.CONSOLE)
2017-07-14 06:49:01 +00:00
main =
2017-07-14 06:43:20 +00:00
HTTPure.serve 8080 router $ Console.log "Server now up on port 8080"
2017-07-10 10:17:13 +00:00
where
2017-09-26 06:08:07 +00:00
router _ = HTTPure.ok "hello world!"
2017-07-10 10:17:13 +00:00
```
2017-05-25 19:12:29 +00:00
## Documentation
Module documentation is published
on [Pursuit ](http://pursuit.purescript.org/packages/purescript-httpure ).
2017-07-10 10:17:13 +00:00
## Examples
2017-07-18 06:16:13 +00:00
HTTPure ships with a number of [examples ](docs/Examples ). To run an example, in
the project root, run:
2017-07-10 10:17:13 +00:00
```bash
make example EXAMPLE=< Example Name >
```
2017-05-25 19:12:29 +00:00
2017-07-10 10:17:13 +00:00
Each example's startup banner will include information on routes available on
the example server.
2017-05-25 19:12:29 +00:00
## Testing
2017-07-10 10:17:13 +00:00
To run the test suite, in the project root run:
2017-05-25 19:12:29 +00:00
```bash
make test
```
## Contributing
We are open to accepting contributions! Please see
2017-07-10 19:52:06 +00:00
the [contributing guide ](Contributing.md ).
2017-05-25 19:12:29 +00:00
## People
HTTPure is written and maintained
by [Connor Prussin ](https://connor.prussin.net ).
We are open to accepting contributions! Please see
2017-07-10 19:52:06 +00:00
the [contributing guide ](Contributing.md ).
2017-05-25 19:12:29 +00:00
## License
2017-07-10 19:52:06 +00:00
[MIT ](License )