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.
## Status
This project is currently an early-stage work in progress. It is not
production-ready yet. You can track what's left before it gets production-ready
2017-05-25 19:16:32 +00:00
by looking at
our [roadmap ](https://github.com/cprussin/purescript-httpure/projects ). If you'd
like to help us get there quicker, please contribute! To get started, check
2017-07-10 19:52:06 +00:00
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-07-14 06:43:20 +00:00
import Prelude (pure, ($))
2017-07-10 10:17:13 +00:00
import Control.Monad.Eff.Console as Console
2017-07-14 06:43:20 +00:00
import Data.StrMap as StrMap
2017-07-10 10:17:13 +00:00
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-07-14 06:43:20 +00:00
router _ = pure $ HTTPure.OK StrMap.empty "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 )