forked from ironhack-labs/lab-express-basic-site
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
24 lines (20 loc) · 641 Bytes
/
Copy pathapp.js
File metadata and controls
24 lines (20 loc) · 641 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const express = require('express');
const app = express();
app.use(express.static('public'));
// our first Route
app.get('/', (request, response, next) => {
// console.log(request);
response.sendFile(__dirname + '/views/home.html');
});
app.get('/about', (request, response, next) => {
// console.log(request);
response.sendFile(__dirname + '/views/about.html');
});
app.get('/works', (request, response, next) => {
// console.log(request);
response.sendFile(__dirname + '/views/works.html');
});
// Server Started
app.listen(3000, () => {
console.log('My first app listening on port 3000!')
});