🔀 Merge pull request #1068 from itsmejoeeey/BUG/1067_Server-fallback-serve-index

🐛 Serve index.html as fallback to fix #1067
This commit is contained in:
Alicia Sykes 2023-02-19 23:53:40 +00:00 committed by GitHub
commit b18895b227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -121,7 +121,9 @@ const app = express()
} catch (e) {
res.end(JSON.stringify({ success: false, message: e }));
}
});
})
// GET fallback endpoint
.get('*', (req, res) => res.sendFile(path.join(__dirname, 'dist', 'index.html')));
/* Create HTTP server from app on port, and print welcome message */
http.createServer(app)