Fix: cause 500 when no url (#129)

This commit is contained in:
MeiMei 2019-03-16 15:14:28 +09:00 committed by syuilo
parent 749e776d6f
commit f45c802a7f

View File

@ -5,6 +5,11 @@ import summaly from '../';
const app = new Koa();
app.use(async ctx => {
if (!ctx.query.url) {
ctx.status = 400;
return;
}
try {
const summary = await summaly(ctx.query.url, {
followRedirects: false