-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
38 lines (21 loc) · 908 Bytes
/
server.js
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
32
33
34
35
36
37
38
// const express = require('express');
// const http = require('http');
// const path = require('path');
// const app = express();
// const port = process.env.PORT || 8080;
// app.use(express.static(__dirname + '/dist/portfolio'));
// app.get('/*', (req, res) => res.sendFile(path.join(__dirname)));
// const server = http.createServer(app);
// server.listen(port, () => console.log(`App running on: http://localhost:${port}`));
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(__dirname + '/dist/portfolio'));
app.listen(process.env.PORT || 8080);
//PathLocationStratergy
//app.use(express.static(__dirname + '/dist/github-login'));
app.get('/*', function(req,res) {
res.sendFile(path.join(__dirname+'/dist/portfolio/index.html'));
//res.sendFile(path.join(__dirname+'/src/index.html'));
});
console.log("server is running");