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.
paste/router.js

19 lines
421 B
JavaScript

const router = require('koa-router')();
const config = require('config');
const pastes = require('./controllers/pastes');
9 years ago
router
.get('/', async (ctx) => {
await ctx.render('index', {
pretty: config.prettyHtml,
title: config.name,
url: ctx.request.origin,
expires: config.expires,
highlights: config.highlights
});
})
.post('/', pastes.create)
.get('/:id', pastes.view);
9 years ago
module.exports = router;