Skip to content

KaleoSoftware/micro-hoofs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

About

🐎 for your πŸ”¬ 😝

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published