-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
26 lines (20 loc) · 764 Bytes
/
server.js
File metadata and controls
26 lines (20 loc) · 764 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
// heroku server file used for entry point
var express = require('express');
var app = express();
// set the port of our application
// process.env.PORT lets the port be set by Heroku
app.set('port', (process.env.PORT || 5000));
// make express look in the public directory for assets (css/js/img)
app.use(express.static(__dirname + '/app'));
// views is directory for all template files
//app.set('views', __dirname + '/views');
//app.set('view engine', 'ejs');
// set the home page route
app.get('/', function(request, response) {
// make sure index is in the right directory.
//In this case /app/index.html
response.render('app/index');
});
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});