Skip to content

Commit

Permalink
🔀 Merge pull request #1068 from itsmejoeeey/BUG/1067_Server-fallback-…
Browse files Browse the repository at this point in the history
…serve-index

🐛 Serve index.html as fallback to fix #1067
  • Loading branch information
Lissy93 authored Feb 19, 2023
2 parents 64d61fc + 12eadcc commit b18895b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b18895b

Please sign in to comment.