-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
28 lines (22 loc) · 712 Bytes
/
Copy pathserver.js
File metadata and controls
28 lines (22 loc) · 712 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
let express = require('express'),
path = require('path');
var app = express();
let server = require('http').Server(app);
var port = process.env.PORT || 8000;
// app.use(express.static(path.join(__dirname)));
app.use(express.static(__dirname + '/'));
app.get('*', (req, res) =>{
res.sendFile(path.resolve(__dirname, 'index.html'));
});
// app.get('/', function(req, res, next) {
// res.sendStatus(200);
// });
// app.get('/index.html', function(req, res,next){
// res.sendFile(path.join(__dirname+"/index.html"));
// });
// app.post('/contact', function(req, res, next){
// res.sendStatus(200);
// });
server.listen(port, function() {
console.log("App is running on port " + port);
});