Redirect / to /dashboard.html
Visiting the bare root path returned Express's default "Cannot GET /" since there was no route or index.html for it. dashboard.js already bounces to /login.html when the session check fails, so this one redirect covers both logged-in and logged-out visitors.
This commit is contained in:
@@ -53,6 +53,12 @@ app.get('/k/:token', (req, res) => {
|
|||||||
res.sendFile(path.join(__dirname, '..', 'public', 'kiosk.html'));
|
res.sendFile(path.join(__dirname, '..', 'public', 'kiosk.html'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// dashboard.js itself bounces to /login.html if the session check fails,
|
||||||
|
// so this one redirect covers both logged-in and logged-out visitors.
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.redirect('/dashboard.html');
|
||||||
|
});
|
||||||
|
|
||||||
app.use(express.static(path.join(__dirname, '..', 'public')));
|
app.use(express.static(path.join(__dirname, '..', 'public')));
|
||||||
|
|
||||||
app.use('/api', (req, res) => {
|
app.use('/api', (req, res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user