Untitled
const express = require('express'); const path = require('path'); const app = express(); // Serve static files from "assets", "view", and "js" folders app.use(express.static(path.join(__dirname, 'assets'))); app.use(express.static(path.join(__dirname, 'view'))); app.use(express.static(path.join(__dirname, 'js'))); // Route for index.html file app.get('/', (req, res) => { res.sendFile(path.join(__dirname, 'view', 'index.html')); }); // Route for Appointments.html file app.get('/appointments', (req, res) => { res.sendFile(path.join(__dirname, 'view', 'Appointments.html')); }); // Route for Doctors.html file app.get('/doctors', (req, res) => { res.sendFile(path.join(__dirname, 'view', 'Doctors.html')); }); // Add additional routes for other HTML files if necessary const PORT = process.env.PORT || 3000; app.listen(PORT, () => { console.log(`Server running on port ${PORT}`); });
Leave a Comment