Add fix for client-side routing the client UI uses

This commit is contained in:
Grant 2024-07-12 03:03:30 -06:00
parent 02329f01a4
commit b9487ba803
1 changed files with 4 additions and 0 deletions

View File

@ -50,7 +50,11 @@ export class ExpressServer {
"Serving client UI at / using root " + "Serving client UI at / using root " +
path.join(__dirname, process.env.SERVE_CLIENT) path.join(__dirname, process.env.SERVE_CLIENT)
); );
const indexFile = path.join(process.env.SERVE_CLIENT, "index.html");
this.app.use(express.static(process.env.SERVE_CLIENT)); this.app.use(express.static(process.env.SERVE_CLIENT));
this.app.use("/chat_callback", (req, res) => {
res.sendFile(indexFile);
});
} else { } else {
this.app.get("/", (req, res) => { this.app.get("/", (req, res) => {
res.status(404).contentType("html").send(` res.status(404).contentType("html").send(`