0.0.5 • Published 7 years ago

micro-hoofs v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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:

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!"}
0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago