Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justinwoo/purescript-makkori
A simple PureScript binding to Express made for easy interop.
https://github.com/justinwoo/purescript-makkori
purescript
Last synced: about 2 months ago
JSON representation
A simple PureScript binding to Express made for easy interop.
- Host: GitHub
- URL: https://github.com/justinwoo/purescript-makkori
- Owner: justinwoo
- License: mit
- Created: 2018-03-07T22:57:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T17:08:41.000Z (over 6 years ago)
- Last Synced: 2024-10-11T23:44:39.838Z (2 months ago)
- Topics: purescript
- Language: PureScript
- Homepage:
- Size: 9.77 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PureScript Makkori
[![Build Status](https://travis-ci.org/justinwoo/purescript-makkori.svg?branch=master)](https://travis-ci.org/justinwoo/purescript-makkori)
Simple bindings to Express made for easy interop.
![](https://i.imgur.com/VK9ADpH.png)
This is an incomplete library. If you find that something is missing, make some FFI/coerced functions to work with and make some issues or PRs. Or make your own library, that's fine too.
## Example
```hs
main = do
app <- M.makeApp
server <- M.listen (M.Port 9999) mempty app
json <- M.makeJSONMiddleware {}
M.use (M.Path "/") json app
M.get
(M.Path "/get-test")
(M.makeHandler (\_ res -> M.sendResponse "GET OK" res))
app
M.post
(M.Path "/post-test")
(M.makeHandler
(\req res -> do
body <- (readString <=< readProp "a") <$> M.getBody req
M.sendResponse "POST OK" res))
appM.close mempty server
```