Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KaleoSoftware/micro-hoofs
🐎 for your 🔬 😝
https://github.com/KaleoSoftware/micro-hoofs
Last synced: 3 months ago
JSON representation
🐎 for your 🔬 😝
- Host: GitHub
- URL: https://github.com/KaleoSoftware/micro-hoofs
- Owner: KaleoSoftware
- Created: 2017-04-01T16:03:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T09:24:03.000Z (almost 8 years ago)
- Last Synced: 2024-07-09T22:49:41.704Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 24
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-micro - micro-hoofs - Higher-order functions for zeit/micro. (Modules / Higher Order)
README
Higher-order functions for zeit/micro
=====================================- `compose()` - because it should be a part of es6 right
- `respondToLivenessProbe` - to respond to k8s liveness probe with `{"healthy": true}`
- `parseJSONInput` - puts input json on `req.json`Example:
```js
const cmd = input => ({
hello: input.world
})module.exports = compose(
respondToLivenessProbe,
parseJSONInput,
process.env.NODE_ENV !== 'production' && visualize
)(async req => cmd(req.json))
```- `curl localhost:3000` -> returns `{"healthy": true}`
- `curl -XPOST -d'{"world": "world!"}' http://localhost:3000` -> returns `{"hello": "world!"}`