mirror of https://github.com/JoeBiellik/paste
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
683 B
JavaScript
32 lines
683 B
JavaScript
require('babel-polyfill');
|
|
require('babel-core/register')({
|
|
presets: ['es2015']
|
|
});
|
|
|
|
var config = require('config');
|
|
var app = require('koa')();
|
|
var router = require('./router');
|
|
var db = require('./db')();
|
|
|
|
app.keys = config.keys;
|
|
app.proxy = true;
|
|
|
|
app.use(require('koa-logger')());
|
|
app.use(require('koa-compress')());
|
|
app.use(require('koa-static-cache')('./public', {
|
|
maxAge: config.cacheAge
|
|
}));
|
|
app.use(require('koa-body')({
|
|
multipart: true,
|
|
jsonLimit: config.sizeLimit,
|
|
formLimit: config.sizeLimit,
|
|
textLimit: config.sizeLimit
|
|
}));
|
|
app.use(require('koa-views')('./views', {
|
|
default: 'jade'
|
|
}));
|
|
|
|
app.use(router.routes(), router.allowedMethods());
|
|
|
|
module.exports = app;
|