Added better API errors and stuff

This commit is contained in:
Jori Lallo
2016-09-11 13:38:52 -07:00
parent 9b49b45fe7
commit 53c3d3c318
6 changed files with 34 additions and 37 deletions

View File

@ -9,16 +9,6 @@ import subdomainRedirect from './middlewares/subdomainRedirect';
const koa = new Koa();
const router = new Router();
// // error handler
// koa.use(async (ctx, next) => {
// try {
// await next();
// } catch (err) {
// ctx.status = err.status || 500;
// ctx.body = err.message;
// }
// });
router.get('/service-worker.js', async (ctx) => {
ctx.set('Content-Type', 'application/javascript');
if (process.env.NODE_ENV === 'production') ctx.set('Cache-Control', `max-age=${30}`);