diff --git a/app.js b/app.js index e69de29..9297e51 100644 --- a/app.js +++ b/app.js @@ -0,0 +1,30 @@ +const express = require('express'); +const path = require('path'); +const app = express(); + + +app.use(express.static(path.join(__dirname, 'public'))); + +app.get('/', (req, res) => { + res.sendFile(path.join(__dirname, 'views', 'index.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')); +}); + + +const PORT = process.env.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..2765b79 --- /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.2" + } +} diff --git a/public/styles.css b/public/styles.css new file mode 100644 index 0000000..16ccc73 --- /dev/null +++ b/public/styles.css @@ -0,0 +1,40 @@ +/* styles.css */ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + } + + header { + background-color: #333; + color: white; + padding: 10px; + text-align: center; + } + + nav ul { + list-style: none; + padding: 0; + } + + nav ul li { + display: inline; + margin-right: 20px; + } + + nav ul li a { + color: white; + text-decoration: none; + } + + main { + padding: 20px; + } + + .gallery img { + width: 30%; + margin: 10px; + border: 2px solid #ddd; + padding: 5px; + } + \ No newline at end of file diff --git a/views/about.html b/views/about.html new file mode 100644 index 0000000..2c871bc --- /dev/null +++ b/views/about.html @@ -0,0 +1,26 @@ + + + + + + About + + + +
+

About Me

+ +
+
+

About the Person

+

Here, you can add some information about the person. It could include their background, interests, and other relevant details.

+
+ + diff --git a/views/gallery.html b/views/gallery.html new file mode 100644 index 0000000..6f73570 --- /dev/null +++ b/views/gallery.html @@ -0,0 +1,30 @@ + + + + + + Gallery + + + +
+

Photo Gallery

+ +
+
+

Gallery of Images

+ +
+ + diff --git a/views/index.html b/views/index.html new file mode 100644 index 0000000..27258dc --- /dev/null +++ b/views/index.html @@ -0,0 +1,26 @@ + + + + + + Home + + + +
+

Welcome to My Website

+ +
+
+

Welcome to the Home Page!

+

This is a simple website built using Express.js.

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

Works

+ +
+
+

Here are some of the works:

+ +
+ +