move web-remote to ejs

This commit is contained in:
vapormusic 2022-01-22 21:43:45 +07:00
parent 756dcc10f7
commit a688d04cec
2 changed files with 5 additions and 0 deletions

View file

@ -201,6 +201,8 @@ export class Win {
*/ */
const remote = express(); const remote = express();
remote.use(express.static(path.join(this.paths.srcPath, "./web-remote/"))) remote.use(express.static(path.join(this.paths.srcPath, "./web-remote/")))
remote.set("views", path.join(this.paths.srcPath, "./web-remote/views"));
remote.set("view engine", "ejs");
getPort({port: 6942}).then((port) => { getPort({port: 6942}).then((port) => {
this.remotePort = port; this.remotePort = port;
remote.listen(this.remotePort, () => { remote.listen(this.remotePort, () => {
@ -218,6 +220,9 @@ export class Win {
} }
firstRequest = false; firstRequest = false;
}) })
remote.get("/", (req, res) => {
res.render("index", this.EnvironmentVariables);
});
}) })
} }