npm.io
1.0.0 • Published 9 years ago

@blended/starter

Licence
MIT
Version
1.0.0
Deps
20
Vulns
11
Weekly
0
DeprecatedThis package is deprecated
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

Build Status

starter

A rest API framework on top of koa

Getting started

$ npm install starter --save

Then setup your application as follows:

// app.js
import starter from 'starter'
import models from './api/models'
import env from './config/env'

let app = starter(env)

export default app

if (require.main === module) {
  let port = process.argv[2]
  models(env.db).then(db => {
    app.db = db
    app.run(port)
  })
}

and run it with node app.js [port]. If no port is set the app will run on port 3000.

Developing

$ yarn install
Test
$ yarn test