diff --git a/app.js b/app.js index e69de29bb..84a603c92 100644 --- a/app.js +++ b/app.js @@ -0,0 +1,15 @@ +const express = require('express'); +const app = express(); + +app.use(express.static('public')); + +app.get('/', (request, response, next) => response.sendFile(__dirname + '/views/home.html')); + +app.get('/about', (request, response, next) => response.json({ + name: "Toni", + age: 27, + height: "1.78" +})); +app.get('/work', (request, response, next) => response.sendFile(__dirname + '/views/work.html')); + +app.listen(3000, () => console.log('My first app listening on port 3000!')); diff --git a/package.json b/package.json new file mode 100644 index 000000000..5f32f1857 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "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", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.19.2" + } +} diff --git a/public/style.css b/public/style.css new file mode 100644 index 000000000..0800b0e15 --- /dev/null +++ b/public/style.css @@ -0,0 +1,4 @@ +body{ + background-color: red; + +} \ No newline at end of file diff --git a/views/home.html b/views/home.html new file mode 100644 index 000000000..fc33591a6 --- /dev/null +++ b/views/home.html @@ -0,0 +1,12 @@ + + + + + + Document + + +

Welcome visitor

+ + + \ No newline at end of file diff --git a/views/work.html b/views/work.html new file mode 100644 index 000000000..9c265a7e8 --- /dev/null +++ b/views/work.html @@ -0,0 +1,12 @@ + + + + + + Document + + + +

This is my html linked to css

+ + \ No newline at end of file