const express = require('express'); const bodyParser = require('body-parser'); const path = require('path'); const userAuthentication = require('../middlewares/userAuthentication'); const { signup } = require('../controller/signup'); const { login } = require('../controller/login'); const PORT = 4000; const app = express(); app.use(bodyParser.urlencoded({extended: true})); app.use(express.static(path.join(__dirname, 'public'))); app.get('/', (req, res) => { res.sendFile(path.join(__dirname, '..', 'public', 'index.html')); }); app.post('/login', login); app.get('/dashboard', userAuthentication, (req, res) => { res.send('