diff --git a/app.js b/app.js index e69de29bb..b23939b9c 100644 --- a/app.js +++ b/app.js @@ -0,0 +1,51 @@ +const express = require("express"); + +const app = express(); + +app.use(express.static('public')); +app.use(express) + +app.get("/home", (req, res) => { + res.send("This is Rocky") + + /* res.json({ + name: "Rocky", + request: "home", + })*/ + +}); + + +app.get("/about", (req, res) => { + res.send("About Rocky") + +}); + +app.get("/work", (req, res) => { + res.send("Gallery of Rocky") + +}); +app.listen(3000, () => { + console.log('Listening server...') +}); + + +app.get('/', (request, response,) => { + response.send(` + + + + + Cat + + + +

ROCKY BALBOA HTML

+

This is my second route OF ROCKY

+ + + + `); +}); + +app.get('/home', (request, response, next) => response.sendFile(__dirname + '/views/index.html')); diff --git a/package.json b/package.json new file mode 100644 index 000000000..d42f020f0 --- /dev/null +++ b/package.json @@ -0,0 +1,77 @@ +{ + "name": "lab-express-basic-site", + "version": "1.0.0", + "description": "![logo_ironhack_blue 7](https://user-images.githubusercontent.com/23629340/40541063-a07a0a8a-601a-11e8-91b5-2f13e4e6b441.png)", + "main": "app.js", + "dependencies": { + "accepts": "^1.3.8", + "array-flatten": "^1.1.1", + "body-parser": "^1.20.2", + "bytes": "^3.1.2", + "call-bind": "^1.0.7", + "content-disposition": "^0.5.4", + "content-type": "^1.0.5", + "cookie": "^0.6.0", + "cookie-signature": "^1.0.6", + "debug": "^2.6.9", + "define-data-property": "^1.1.4", + "depd": "^2.0.0", + "destroy": "^1.2.0", + "ee-first": "^1.1.1", + "encodeurl": "^1.0.2", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "express": "^4.19.2", + "finalhandler": "^1.2.0", + "forwarded": "^0.2.0", + "fresh": "^0.5.2", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "http-errors": "^2.0.0", + "iconv-lite": "^0.4.24", + "inherits": "^2.0.4", + "ipaddr.js": "^1.9.1", + "media-typer": "^0.3.0", + "merge-descriptors": "^1.0.1", + "methods": "^1.1.2", + "mime": "^1.6.0", + "mime-db": "^1.52.0", + "mime-types": "^2.1.35", + "ms": "^2.0.0", + "negotiator": "^0.6.3", + "object-inspect": "^1.13.1", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "path-to-regexp": "^0.1.7", + "proxy-addr": "^2.0.7", + "qs": "^6.11.0", + "range-parser": "^1.2.1", + "raw-body": "^2.5.2", + "safe-buffer": "^5.2.1", + "safer-buffer": "^2.1.2", + "send": "^0.18.0", + "serve-static": "^1.15.0", + "set-function-length": "^1.2.2", + "setprototypeof": "^1.2.0", + "side-channel": "^1.0.6", + "statuses": "^2.0.1", + "toidentifier": "^1.0.1", + "type-is": "^1.6.18", + "unpipe": "^1.0.0", + "utils-merge": "^1.0.1", + "vary": "^1.1.2" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/public/rocky.jpg b/public/rocky.jpg new file mode 100644 index 000000000..bd1a1907f Binary files /dev/null and b/public/rocky.jpg differ diff --git a/public/style.css b/public/style.css new file mode 100644 index 000000000..c680273da --- /dev/null +++ b/public/style.css @@ -0,0 +1,5 @@ +body { + color: blue; + background-color: rgb(5, 5, 5); + } + \ No newline at end of file diff --git a/views/index.html b/views/index.html new file mode 100644 index 000000000..5f1819e54 --- /dev/null +++ b/views/index.html @@ -0,0 +1,17 @@ + + + + + Rocky Balboa + + + + +

Rocky Balboa

+ +

This is my second route

+ + + + + \ No newline at end of file