|
|
@ -5,10 +5,11 @@ import * as serveStatic from "serve-static"; |
|
|
|
// tslint:disable-next-line:no-var-requires
|
|
|
|
// tslint:disable-next-line:no-var-requires
|
|
|
|
const paths = require("paths"); |
|
|
|
const paths = require("paths"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const staticDir = path.resolve(paths.publicDir, "static"); |
|
|
|
const index = path.join(paths.publicDir, "index.html"); |
|
|
|
const index = path.join(paths.publicDir, "index.html"); |
|
|
|
|
|
|
|
|
|
|
|
export default function serveApp(app: Express) { |
|
|
|
export default function serveApp(app: Express) { |
|
|
|
app.use(serveStatic(paths.clientBuildDir)); |
|
|
|
app.use("/static", serveStatic(staticDir, { fallthrough: false })); |
|
|
|
app.get("/*", (req, res) => { |
|
|
|
app.get("/*", (req, res) => { |
|
|
|
res.sendFile(index); |
|
|
|
res.sendFile(index); |
|
|
|
}); |
|
|
|
}); |
|
|
|