-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
42 lines (37 loc) · 999 Bytes
/
app.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
var express = require('express'),
pug = require('pug'),
app = express();
/* app setup */
app.set('port', (process.env.PORT || 5001));
app.use(express.static(__dirname + '/dist'));
app.get('/', (req, res) => {
res.render('/index.html')
});
/* --- */
/* dev */
/* app.set('port', (process.env.PORT || 4000));
app.use(express.static(__dirname + '/src'));
app.set('views', __dirname + '/src/view');
app.set('view engine', 'pug');
app.get('/', (req, res) => {
res.render('index')
}); */
/* auxiliary routing */
app.get('/google885327df46f587f4.html', (req, res) => {
res.sendFile('google885327df46f587f4.html')
});
app.get('/images/me.jpg', (req, res) => {
res.sendFile('images/me.jpg')
});
app.get('/images/favicon.ico', (req, res) => {
res.sendFile('images/favicon.ico')
});
app.get('/favicon.ico', (req, res) => {
res.sendFile('images/favicon.ico')
});
/* --- */
/* listner */
app.listen(app.get('port'), () => {
console.log('Node app is running on port', app.get('port'));
});
/* --- */