koa opinions
Originally forked from koajs/common
Installation
$ npm install opinion
default configuration
a builtin routing mechanism
An extensive default middleware stack
DEFAULT_MIDDLEWARE_STACK = NoKeepAlive: commonNoKeepAlive responseTime: commonresponseTime logger: commonlogger compress: commoncompress conditionalGet: commonconditionalGet etag: commonetag statics: commonstatics session: commonsession csrf: commoncsrf router: commonrouter;
The request ctx
has been extended with a send
method to send files, and a render
method to render views using any consolidate
compatible render engine, or plain html
files.
And as a extra bonus, socket.io
is builtin and can be enabled by configuration flag.
Usage
"use strict";var opinion = ; var app = ; // simple routeapp; // a CORS enabled proxy to `gist.github.com`app; app; // websocket push example;
License
MIT