Merge pull request #82 from tycrek/improve-index-loading

pull/84/head
Josh Moore 3 years ago committed by GitHub
commit fe0a357c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -66,7 +66,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(`./${indexFile}`) && (typeof require(`./${indexFile}`) === typeof Function);
app.get('/', (req, res, next) => ASS_INDEX // skipcq: JS-0229
? ASS_INDEX(req, res, next)
: fs.readFile(path('README.md'))

Loading…
Cancel
Save