diff --git a/app.js b/app.js index e69de29..aed4c7e 100644 --- a/app.js +++ b/app.js @@ -0,0 +1,30 @@ +const express = require('express'); +const path = require('path'); + +const app = express(); + +// Set up middleware to serve static files +app.use(express.static(path.join(__dirname, 'public'))); + +// Define 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 = 3000; +app.listen(PORT, () => { + console.log(`Server is running on http://localhost:${PORT}`); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..b28b452 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "lab-express-basic", + "version": "1.0.0", + "description": "", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.21.1" + } +} diff --git a/public/css/styles.css b/public/css/styles.css new file mode 100644 index 0000000..a24fbba --- /dev/null +++ b/public/css/styles.css @@ -0,0 +1,42 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + text-align: center; + } + + h1 { + color: #333; + } + + nav ul { + list-style-type: none; + padding: 0; + } + + nav ul li { + display: inline; + margin: 0 15px; + } + + nav ul li a { + text-decoration: none; + color: #007BFF; + } + + nav ul li a:hover { + text-decoration: underline; + } + + .gallery img { + width: 200px; + height: auto; + margin: 10px; + border: 2px solid #ddd; + border-radius: 5px; + } + + .gallery img:hover { + border-color: #007BFF; + } + \ No newline at end of file diff --git a/public/images/photo1.jpg b/public/images/photo1.jpg new file mode 100644 index 0000000..4fce088 Binary files /dev/null and b/public/images/photo1.jpg differ diff --git a/public/images/photo2.jpg b/public/images/photo2.jpg new file mode 100644 index 0000000..9afe52a Binary files /dev/null and b/public/images/photo2.jpg differ diff --git a/public/images/photo3.jpg b/public/images/photo3.jpg new file mode 100644 index 0000000..f193521 Binary files /dev/null and b/public/images/photo3.jpg differ diff --git a/views/about.html b/views/about.html new file mode 100644 index 0000000..068c9e9 --- /dev/null +++ b/views/about.html @@ -0,0 +1,14 @@ + + + + + + About + + + +

About Me

+

This page contains some basic information about the person.

+ Back to Home + + diff --git a/views/gallery.html b/views/gallery.html new file mode 100644 index 0000000..4525b32 --- /dev/null +++ b/views/gallery.html @@ -0,0 +1,18 @@ + + + + + + Gallery + + + +

Photo Gallery

+ + Back to Home + + diff --git a/views/home.html b/views/home.html new file mode 100644 index 0000000..cf9314a --- /dev/null +++ b/views/home.html @@ -0,0 +1,19 @@ + + + + + + Home + + + +

Welcome to My Website!

+ + + diff --git a/views/works.html b/views/works.html new file mode 100644 index 0000000..934cdc4 --- /dev/null +++ b/views/works.html @@ -0,0 +1,19 @@ + + + + + + Works + + + +

My Works

+

Here are some of my amazing works:

+ + Back to Home + +