punky

0.4.0 • Public • Published

punky

Build Status js-standard-style

Bootstrap your APIs taking advantage of the best community modules

Quickstart

  • Create app.js:
'use strict'
 
const Punky = require('punky')
const Router = require('express').Router
 
const punky = new Punky(/* options */)
 
if (punky.app) {
  const router = Router()
  const body = new Buffer('Hello World')
  const message = body.toString('utf8')
 
  router.get('/', (req, res, next) => {
    req.log.info(message)
    req.metrics.increment('home')
    res.set('Content-Type', 'text/html')
    res.send(body)
  })
 
  punky.app.use(router)
}
 
punky.run().catch(punky.logger.error)
  • Run:
$ node app.js

Dependents (0)

Package Sidebar

Install

npm i punky

Weekly Downloads

2

Version

0.4.0

License

BSD-3-Clause

Last publish

Collaborators

  • dgaubert