-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
23 lines (15 loc) · 659 Bytes
/
Copy pathapp.js
File metadata and controls
23 lines (15 loc) · 659 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var express = require('express');
var app = express();
var path = require('path');
const port = process.env.PORT || 3000;
app.use(express.static(path.join(__dirname, 'public'))); // "public" off of current is root
// app.use(express.static(path.join(__dirname, 'css'))); // "public" off of current is root
// app.use(express.static(path.join(__dirname, 'images'))); // "public" off of current is root
app.get('/', (req, res) => {
res.sendFile(__dirname + '/index.html');
});
app.get('/custom', (req, res) => {
res.sendFile(__dirname + '/customTag.html');
});
console.log("serer started on " + `http://localhost:${port}`)
app.listen(port);