From 690299ac6bd46d0891326128f0266fe376c38f47 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 21 Sep 2019 12:28:34 -0700 Subject: [PATCH] Redirect unknown integration to integrations home, rather than 404 --- server/routes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/routes.js b/server/routes.js index 7dbb1a69d..ccbc10be4 100644 --- a/server/routes.js +++ b/server/routes.js @@ -70,7 +70,9 @@ router.get('/privacy', ctx => renderpage(ctx, )); router.get('/integrations/:slug', async ctx => { const slug = ctx.params.slug; const integration = find(integrations, i => i.slug === slug); - if (!integration) throw new Error('Not found'); + if (!integration) { + return ctx.redirect(`${process.env.URL}/integrations`); + } const content = await fs.readFile( path.resolve(__dirname, `pages/integrations/${slug}.md`)