You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
368 B
15 lines
368 B
7 years ago
|
import { Express } from "express";
|
||
7 years ago
|
import * as path from "path";
|
||
7 years ago
|
import * as serveStatic from "serve-static";
|
||
7 years ago
|
|
||
7 years ago
|
import * as paths from "paths";
|
||
7 years ago
|
|
||
7 years ago
|
const index = path.join(paths.publicDir, "index.html");
|
||
|
|
||
7 years ago
|
export default function serveApp(app: Express) {
|
||
7 years ago
|
app.use(serveStatic(paths.appBuildDir));
|
||
7 years ago
|
app.get("/*", (req, res) => {
|
||
7 years ago
|
res.sendFile(index);
|
||
7 years ago
|
});
|
||
7 years ago
|
}
|