This commit is contained in:
BIG2EYEZ
2023-12-17 21:35:18 +08:00
parent 7915228119
commit e84b97fe40
2 changed files with 80 additions and 78 deletions

View File

@ -103,7 +103,6 @@ app.get('/home', isAuthenticated, (req, res) => {
res.render('home', { username: req.session.username, loginLogs: loginResults });
});
});
app.get('/inusers', isAuthenticated, (req, res) => {
// Fetch all user data from the database
const allUsersQuery = 'SELECT * FROM users';
@ -115,11 +114,15 @@ app.get('/inusers', isAuthenticated, (req, res) => {
return;
}
// Render the inusers page with all user data
res.render('inusers', { allUsers: allUsers });
// Render the inusers page with JSON data
res.render('inusers', { allUsers });
});
});
app.use(express.static('views'));
app.listen(PORT, () => {