From c78ccdd5f7ac4c427b2a889e2bd0d8cce9aa3964 Mon Sep 17 00:00:00 2001 From: Elsa2116 Date: Sun, 23 Mar 2025 04:25:00 -0400 Subject: [PATCH 1/2] done --- app.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app.js b/app.js index e69de29..af0ee6b 100644 --- a/app.js +++ b/app.js @@ -0,0 +1,29 @@ +const express = require('express'); +const app = express(); +const path = require('path'); + +// Set up static files +app.use(express.static(path.join(__dirname, 'public'))); + +// Routes +app.get('/', (req, res) => { + res.sendFile(path.join(__dirname, 'views', 'home.html')); +}); + +app.get('/about', (req, res) => { + res.sendFile(path.join(__dirname, 'views', 'about.html')); +}); + +app.get('/works', (req, res) => { + res.sendFile(path.join(__dirname, 'views', 'works.html')); +}); + +app.get('/gallery', (req, res) => { + res.sendFile(path.join(__dirname, 'views', 'gallery.html')); +}); + +// Start the server +const PORT = process.env.PORT || 3000; +app.listen(PORT, () => { + console.log(`Server is running on http://localhost:${PORT}`); +}); From fa9491d439034f4dd893d7136ac4ce02e25eb026 Mon Sep 17 00:00:00 2001 From: Elsa2116 Date: Sun, 23 Mar 2025 04:26:22 -0400 Subject: [PATCH 2/2] solved lab