-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
31 lines (21 loc) · 739 Bytes
/
app.js
File metadata and controls
31 lines (21 loc) · 739 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
25
26
27
28
29
30
31
const express = require('express');
const path = require('path');
var port = process.env.PORT || 3000;
var app = express();
const router = express.Router();
app.use(express.static(path.join(__dirname, 'public')));
console.log(`app running on port ${port}`);
app.get("/page-1", (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'page-1.html'));
});
app.get("/page-2", (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'page-2.html'));
});
app.get("/page-3", (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'page-3.html'));
});
app.get("/ppt", (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'ppt.html'));
});
app.listen(port);
console.log(`app running on port ${port}`);