purescript-httpurple/Readme.md

106 lines
2.6 KiB
Markdown
Raw Normal View History

# HTTPure
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/cprussin/purescript-httpure/main/License)
[![Latest release](http://img.shields.io/github/release/cprussin/purescript-httpure.svg)](https://github.com/cprussin/purescript-httpure/releases)
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)
A purescript HTTP server framework.
2017-09-26 14:47:05 +00:00
HTTPure is:
2017-10-26 21:42:08 +00:00
- Well-tested (see our [tests](./test/Test))
2017-09-26 14:47:05 +00:00
- 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)
## 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,
2017-10-26 20:28:47 +00:00
check our [contributing guide](./Contributing.md).
## Installation
```bash
spago install httpure
```
2017-07-10 10:17:13 +00:00
## Quick Start
```purescript
module Main where
import Prelude
2017-07-10 10:17:13 +00:00
import Effect.Console (log)
import HTTPure (ServerM, serve, ok)
2017-07-10 10:17:13 +00:00
main :: ServerM
main = serve 8080 router $ log "Server now up on port 8080"
2017-07-10 10:17:13 +00:00
where
router _ = ok "hello world!"
2017-07-10 10:17:13 +00:00
```
## Documentation
Module documentation is published
on [Pursuit](http://pursuit.purescript.org/packages/purescript-httpure).
2017-10-26 20:28:47 +00:00
You can also take a look at [our guides](./docs).
2017-07-10 10:17:13 +00:00
## Examples
2017-10-26 20:28:47 +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
nix-shell --run 'example <Example Name>'
```
Or, without `nix`:
```bash
spago -x test.dhall run --main Examples.<Example Name>.Main
2017-07-10 10:17:13 +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.
## Testing
2017-07-10 10:17:13 +00:00
To run the test suite, in the project root run:
```bash
nix-shell --run check
```
Or, if `nix` isn't your thing:
```bash
purs-tidy check src test docs && spago -x test.dhall test
```
## Contributing
We are open to accepting contributions! Please see
2017-07-10 19:52:06 +00:00
the [contributing guide](Contributing.md).
## People
HTTPure is written and maintained
2018-08-09 19:51:14 +00:00
by [Connor Prussin](https://connor.prussin.net) and [Petri
Lehtinen](http://www.digip.org/).
We are open to accepting contributions! Please see
2017-10-26 20:28:47 +00:00
the [contributing guide](./Contributing.md).
## License
2017-10-26 20:28:47 +00:00
[MIT](./License)