From 3a59710e82f6c8e57270e67805755f8dd1ec4264 Mon Sep 17 00:00:00 2001 From: Ananya Singh <90714878+Ananyasingh2002@users.noreply.github.com> Date: Sun, 19 Feb 2023 13:00:14 +0530 Subject: [PATCH] Create parallax.js --- parallax.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 parallax.js diff --git a/parallax.js b/parallax.js new file mode 100644 index 0000000..6af246e --- /dev/null +++ b/parallax.js @@ -0,0 +1,25 @@ +const http = require('http'); +const fs = require('fs'); + +const hostname = '127.0.0.1'; +const port = 3000; +const home = fs.readFileSync('./index.html') + +const server = http.createServer((req, res) => { + console.log(req.url); + url = req.url; + res.statusCode = 200; + res.setHeader('Content-Type', 'text/html'); + if (url == '/') { + res.end(home); + } + else{ + res.statusCode = 404; + res.end("