From 321738a51740f475205562d49938d835328cddeb Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Wed, 27 Jun 2018 12:12:14 -0600 Subject: [PATCH] Added wildcard route for react router --- server/app/serveApp.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/app/serveApp.ts b/server/app/serveApp.ts index 872e973..fd8b111 100644 --- a/server/app/serveApp.ts +++ b/server/app/serveApp.ts @@ -5,4 +5,7 @@ import * as paths from "paths"; export default function serveApp(app: Express) { app.use(serveStatic(paths.appBuildDir)); + app.get("/*", (req, res) => { + res.sendFile(path.join(paths.publicDir, "index.html")); + }); }