fix linter errors

This commit is contained in:
Jakub Blažej 2022-07-03 21:40:11 +02:00
parent d1caecde98
commit bd112b497a
2 changed files with 8 additions and 6 deletions

View File

@ -154,7 +154,7 @@ let needSetup = false;
await initDatabase(testMode);
exports.entryPage = await setting("entryPage");
const mainRouter = express.Router();
await StatusPage.loadDomainMappingList();
@ -232,7 +232,7 @@ let needSetup = false;
response.send(server.indexHTML);
}
});
app.use(server.basePath, mainRouter);
log.info("server", "Adding socket handler");

View File

@ -55,7 +55,7 @@ class UptimeKumaServer {
if (!basePathEnv.endsWith("/")) {
basePathEnv = basePathEnv + "/";
}
this.basePath = basePathEnv;
log.info("server", "Creating express and socket.io instance");
@ -74,7 +74,7 @@ class UptimeKumaServer {
try {
this.indexHTML = fs.readFileSync("./dist/index.html").toString();
this.indexHTML = this.indexHTML.replace(/<base href.*?\>/, `<base href="${this.basePath}">`);
this.indexHTML = this.indexHTML.replace(/<base href.*?>/, `<base href="${this.basePath}">`);
} catch (e) {
// "dist/index.html" is not necessary for development
if (process.env.NODE_ENV !== "development") {
@ -82,8 +82,10 @@ class UptimeKumaServer {
process.exit(1);
}
}
this.io = new Server(this.httpServer, {path: this.basePath + "socket.io"});
this.io = new Server(this.httpServer, {
path: this.basePath + "socket.io"
});
}
async sendMonitorList(socket) {