Fixed incorrect path check for custom index

pull/62/head
tycrek 3 years ago
parent 934398659d
commit f201792193
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -69,7 +69,7 @@ useSsl && app.use(helmet.hsts({ preload: true })); // skipcq: JS-0093
app.use(nofavicon);
// Use custom index, otherwise render README.md
const ASS_INDEX = indexFile !== '' && fs.existsSync(`../${indexFile}`) && require(`../${indexFile}`);
const ASS_INDEX = indexFile !== '' && fs.existsSync(path(`${indexFile}`)) && require(`../${indexFile}`);
const ASS_INDEX_ENABLED = typeof ASS_INDEX === typeof Function;
app.get('/', (req, res, next) => ASS_INDEX_ENABLED // skipcq: JS-0229
? ASS_INDEX(req, res, next)

Loading…
Cancel
Save