fixed blank index file bug

pull/54/head
tycrek 3 years ago
parent 63dbfcbc5c
commit 45a573dec0
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

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

4
package-lock.json generated

@ -1,12 +1,12 @@
{ {
"name": "ass", "name": "ass",
"version": "0.8.4", "version": "0.8.5",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ass", "name": "ass",
"version": "0.8.4", "version": "0.8.5",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@tycrek/ass-storage-engine": "^0.2.7", "@tycrek/ass-storage-engine": "^0.2.7",

@ -1,6 +1,6 @@
{ {
"name": "ass", "name": "ass",
"version": "0.8.4", "version": "0.8.5",
"description": "The superior self-hosted ShareX server", "description": "The superior self-hosted ShareX server",
"main": "ass.js", "main": "ass.js",
"engines": { "engines": {

Loading…
Cancel
Save