404 on unknown preview route

This commit is contained in:
Jori Lallo
2017-11-12 15:04:46 -08:00
parent 348e5f0b20
commit 6b94e728a1

View File

@ -1,6 +1,7 @@
// @flow
import Koa from 'koa';
import Router from 'koa-router';
import httpErrors from 'http-errors';
import { Mailer } from '../mailer';
const emailPreviews = new Koa();
@ -18,7 +19,7 @@ router.get('/:type/:format', async ctx => {
previewMailer.welcome('user@example.com');
break;
default:
console.log(1);
throw httpErrors.NotFound();
}
if (!mailerOutput) return;