fix lint warnings

This commit is contained in:
Jakub Blažej 2021-12-24 13:27:47 +01:00
parent 4f8826cf5c
commit 92a064d09d
2 changed files with 11 additions and 10 deletions

View file

@ -76,13 +76,14 @@ if (hostname) {
const port = parseInt(process.env.UPTIME_KUMA_PORT || process.env.PORT || args.port || 3001); const port = parseInt(process.env.UPTIME_KUMA_PORT || process.env.PORT || args.port || 3001);
let basePathEnv = process.env.UPTIME_KUMA_BASE_PATH || process.env.BASE_PATH || '/'; let basePathEnv = process.env.UPTIME_KUMA_BASE_PATH || process.env.BASE_PATH || "/";
if (!basePathEnv.startsWith('/')) if (!basePathEnv.startsWith("/")) {
basePathEnv = '/' + basePathEnv; basePathEnv = "/" + basePathEnv;
}
if (!basePathEnv.endsWith('/')) if (!basePathEnv.endsWith("/")) {
basePathEnv = basePathEnv + '/'; basePathEnv = basePathEnv + "/";
}
const basePath = basePathEnv; const basePath = basePathEnv;
@ -123,7 +124,7 @@ if (sslKey && sslCert) {
server = http.createServer(app); server = http.createServer(app);
} }
const io = new Server(server, {path: basePath + 'socket.io'}); const io = new Server(server, {path: basePath + "socket.io"});
module.exports.io = io; module.exports.io = io;
// Must be after io instantiation // Must be after io instantiation
@ -175,7 +176,7 @@ let indexHTML = "";
try { try {
indexHTML = fs.readFileSync("./dist/index.html").toString(); indexHTML = fs.readFileSync("./dist/index.html").toString();
indexHTML = indexHTML.replace(/\<base href.*?\>/, `<base href="${basePath}">`); indexHTML = indexHTML.replace(/<base href.*?>/, `<base href="${basePath}">`);
} catch (e) { } catch (e) {
// "dist/index.html" is not necessary for development // "dist/index.html" is not necessary for development
if (process.env.NODE_ENV !== "development") { if (process.env.NODE_ENV !== "development") {

View file

@ -1,3 +1,3 @@
module.exports = { module.exports = {
publicPath: './', publicPath: "./",
} };