-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathstart.js
More file actions
31 lines (21 loc) · 738 Bytes
/
start.js
File metadata and controls
31 lines (21 loc) · 738 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
29
30
31
var express = require('express');
var app = express();
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname));
// views is directory for all template files
app.set('views', __dirname + '/html');
app.set('view engine', 'ejs');
app.get('/', function(request, response) {
response.render('pages/index');
});
app.get('/album', function(request, response) {
response.render('pages/album');
});
app.get('/history', function(request, response) {
response.render('pages/history');
});
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});
// This file is what handles incoming requests and
// serves files to the browser, or executes server-side code