koa-app
koa, bundled with middlewares and plugins
Last updated 7 years ago by robinqu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install koa-app 
SYNC missed versions from official npm registry.

koa-app

An opinionated selection of koa middlewares/plugins to boost the project scaffolding.

忍受不了每次新建一个koa应用都要不断的去npm install各种middlewares,那就试试这个吧。

我不做框架,只做大自然的搬运工!

Bundled Middlewares

  • koa-body
  • koa-flash
  • koa-gzip
  • koa-i18n
  • koa-locale
  • koa-locals
  • koa-methodoverride
  • koa-sess
  • koa-static

Usage

var koa = require("koa-app");
var app = koa();

//important!
app.configure({
  
  //static file folders to be hosted
  statics: ["folder1", "folder2"],
  
  // options passed to `koa-sess`
  session: {},
  
  //optiosn passed to `koa-i18n`
  i18n: {}
  
  //if we should generate random `app.keys` for you
  generateKey: true
  
  
});

app.listen({
  // bind port
  port: 8080,
  
  // using SSL or not
  secured: true,
  
  // should provide cert and private key content
  certs: {
    key: "xxxx",
    cert: xxx
  },
  
  // force to drop all socket connections on `server.close()`
  autoDrop: true
  
}, function() {
  console.log("app is up and running");
});

License

See LICENSE

Current Tags

  • 0.1.1                                ...           latest (7 years ago)

2 Versions

  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (14)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |