diff --git a/app.js b/app.js index e69de29..40099f0 100644 --- a/app.js +++ b/app.js @@ -0,0 +1,31 @@ +const express = require("express"); +const path = require("path"); + +const app = express(); +const PORT = 3000; + +// Serve static files (CSS, images, JS) +app.use(express.static(path.join(__dirname, "public"))); + +// Routes +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")); +}); + +// Bonus +app.get("/gallery", (req, res) => { + res.sendFile(path.join(__dirname, "views", "gallery.html")); +}); + +// Start server +app.listen(PORT, () => { + console.log(`Server running on http://localhost:${PORT}`); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..251a9c9 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "lab-express-basic", + "version": "1.0.0", + "description": "", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/SiyaM108/lab-express-basic.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/SiyaM108/lab-express-basic/issues" + }, + "homepage": "https://github.com/SiyaM108/lab-express-basic#readme", + "dependencies": { + "express": "^5.2.1" + } +} diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..9d4841f --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,31 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + background-color: #f4f4f4; +} + +header { + background-color: #2c3e50; + color: white; + padding: 1rem; +} + +nav a { + color: white; + margin-right: 1rem; + text-decoration: none; +} + +nav a:hover { + text-decoration: underline; +} + +main { + padding: 2rem; +} + +.gallery img { + width: 200px; + margin: 10px; + border-radius: 8px; +} diff --git a/public/images/Miyazaki-Hayao-2008.webp b/public/images/Miyazaki-Hayao-2008.webp new file mode 100644 index 0000000..335eb0a Binary files /dev/null and b/public/images/Miyazaki-Hayao-2008.webp differ diff --git a/public/images/Spirited-Away-hayao-miyazaki-39923023-1280-1024.jpg b/public/images/Spirited-Away-hayao-miyazaki-39923023-1280-1024.jpg new file mode 100644 index 0000000..fb100c3 Binary files /dev/null and b/public/images/Spirited-Away-hayao-miyazaki-39923023-1280-1024.jpg differ diff --git a/public/images/hayao-miyazaki.jpg b/public/images/hayao-miyazaki.jpg new file mode 100644 index 0000000..90ef905 Binary files /dev/null and b/public/images/hayao-miyazaki.jpg differ diff --git a/public/images/howls-moving-castle.jpg b/public/images/howls-moving-castle.jpg new file mode 100644 index 0000000..a9a044d Binary files /dev/null and b/public/images/howls-moving-castle.jpg differ diff --git a/public/images/my-neighbour-totoro.jpg b/public/images/my-neighbour-totoro.jpg new file mode 100644 index 0000000..25f9b57 Binary files /dev/null and b/public/images/my-neighbour-totoro.jpg differ diff --git a/public/images/princess-mononoke.jpg b/public/images/princess-mononoke.jpg new file mode 100644 index 0000000..b18cef6 Binary files /dev/null and b/public/images/princess-mononoke.jpg differ diff --git a/public/images/rare-2024-movie-about-studio-ghibli-s-hayao-miyazaki-gets-free-u-s-screening.avif b/public/images/rare-2024-movie-about-studio-ghibli-s-hayao-miyazaki-gets-free-u-s-screening.avif new file mode 100644 index 0000000..572ccc3 Binary files /dev/null and b/public/images/rare-2024-movie-about-studio-ghibli-s-hayao-miyazaki-gets-free-u-s-screening.avif differ diff --git a/views/about.html b/views/about.html new file mode 100644 index 0000000..e54e905 --- /dev/null +++ b/views/about.html @@ -0,0 +1,27 @@ + + + + + About Miyazaki + + + +
+

About Hayao Miyazaki

+ +
+ +
+

+ Hayao Miyazaki is a Japanese animator, filmmaker, and co-founder of + Studio Ghibli. His films are known for their imagination, emotional + depth, and strong environmental themes. +

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

Photo Gallery

+ +
+ +
+ Spirited Away + Howl's Moving Castle + My Neighbour Totoro + Princess Mononoke + Hayao Miyazaki +
+ + diff --git a/views/index.html b/views/index.html new file mode 100644 index 0000000..7a24723 --- /dev/null +++ b/views/index.html @@ -0,0 +1,26 @@ + + + + + Hayao Miyazaki + + + +
+

Welcome to Hayao Miyazaki’s World

+ +
+ +
+

+ Discover the life and works of Hayao Miyazaki, one of the greatest + animation directors of all time. +

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

Famous Works

+ +
+ +
+ +
+ +