404 on unknown preview route
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import Koa from 'koa';
|
import Koa from 'koa';
|
||||||
import Router from 'koa-router';
|
import Router from 'koa-router';
|
||||||
|
import httpErrors from 'http-errors';
|
||||||
import { Mailer } from '../mailer';
|
import { Mailer } from '../mailer';
|
||||||
|
|
||||||
const emailPreviews = new Koa();
|
const emailPreviews = new Koa();
|
||||||
@@ -18,7 +19,7 @@ router.get('/:type/:format', async ctx => {
|
|||||||
previewMailer.welcome('user@example.com');
|
previewMailer.welcome('user@example.com');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log(1);
|
throw httpErrors.NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mailerOutput) return;
|
if (!mailerOutput) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user