mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-04 08:25:57 +00:00
fix lint warnings
This commit is contained in:
parent
4f8826cf5c
commit
92a064d09d
2 changed files with 11 additions and 10 deletions
|
@ -76,13 +76,14 @@ if (hostname) {
|
|||
|
||||
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('/'))
|
||||
basePathEnv = '/' + basePathEnv;
|
||||
|
||||
if (!basePathEnv.endsWith('/'))
|
||||
basePathEnv = basePathEnv + '/';
|
||||
if (!basePathEnv.startsWith("/")) {
|
||||
basePathEnv = "/" + basePathEnv;
|
||||
}
|
||||
if (!basePathEnv.endsWith("/")) {
|
||||
basePathEnv = basePathEnv + "/";
|
||||
}
|
||||
|
||||
const basePath = basePathEnv;
|
||||
|
||||
|
@ -123,7 +124,7 @@ if (sslKey && sslCert) {
|
|||
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;
|
||||
|
||||
// Must be after io instantiation
|
||||
|
@ -175,7 +176,7 @@ let indexHTML = "";
|
|||
|
||||
try {
|
||||
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) {
|
||||
// "dist/index.html" is not necessary for development
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module.exports = {
|
||||
publicPath: './',
|
||||
}
|
||||
publicPath: "./",
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue