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.
19 lines
421 B
JavaScript
19 lines
421 B
JavaScript
const router = require('koa-router')();
|
|
const config = require('config');
|
|
const pastes = require('./controllers/pastes');
|
|
|
|
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);
|
|
|
|
module.exports = router;
|