-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
56 lines (42 loc) · 1.47 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const express = require('express');
const bodyParser = require('body-parser');
const PORT = process.env.PORT || 4000;
const app = express();
app.use(bodyParser.urlencoded());
app.get('/', function (req, res) {
res.sendFile( __dirname + '/public/age.html')
});
app.get('/public/index.html', function (req, res) {
res.sendFile( __dirname + '/public/index.html')
});
app.get('/public/404.html', function (req, res) {
res.sendFile( __dirname + '/public/404.html')
});
app.get('/public/css/app.css', function (req, res) {
res.sendFile( __dirname + '/public/css/app.css')
});
app.get('/public/js/app.js', function (req, res) {
res.sendFile( __dirname + '/public/js/app.js')
});
app.get('/public/js/pics.js', function (req, res) {
res.sendFile( __dirname + '/public/js/pics.js')
});
app.get('/public/js/title.js', function (req, res) {
res.sendFile( __dirname + '/public/js/title.js')
});
app.get('/public/js/comments.js', function (req, res) {
res.sendFile( __dirname + '/public/js/comments.js')
});
app.get('/public/js/time.js', function (req, res) {
res.sendFile( __dirname + '/public/js/time.js')
});
app.get('/public/maxresdefault.jpg', function (req, res) {
res.sendFile( __dirname + '/public/maxresdefault.jpg')
});
app.post( '/', function (req, res) {
console.log('response', req.body)
res.end();
});
const server = app.listen(PORT, '0.0.0.0', () => {
console.log('Server Listening. . .')
});