|
|
|
@ -22,18 +22,7 @@ const body = require('koa-body')({
|
|
|
|
const pastes = require('./controllers/pastes');
|
|
|
|
const pastes = require('./controllers/pastes');
|
|
|
|
|
|
|
|
|
|
|
|
router
|
|
|
|
router
|
|
|
|
.get('/', conditional, etag, async (ctx) => {
|
|
|
|
.get('/', conditional, etag, pastes.index)
|
|
|
|
ctx.set('Cache-Control', 'public');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await ctx.render('index', {
|
|
|
|
|
|
|
|
pretty: config.prettyHtml,
|
|
|
|
|
|
|
|
title: config.name,
|
|
|
|
|
|
|
|
url: ctx.request.origin,
|
|
|
|
|
|
|
|
expires: config.expires,
|
|
|
|
|
|
|
|
expiresDefault: config.expiresDefault,
|
|
|
|
|
|
|
|
highlights: config.highlights
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.post('/', body, pastes.create)
|
|
|
|
.post('/', body, pastes.create)
|
|
|
|
.get('/:id', conditional, etag, pastes.view);
|
|
|
|
.get('/:id', conditional, etag, pastes.view);
|
|
|
|
|
|
|
|
|
|
|
|
|