-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
39 lines (31 loc) · 1.29 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
var express = require('express');
var routes = require('./routes/routes');
var app = express();
var http = require('http');
// Define the view (templating) engine
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
// Routes
app.get('/', routes.index);
// app.get('/recommendations/:operation', routes.mongo)
// Handle static files
app.use(express.static(__dirname + '/public'));
/*
* OpenShift will provide environment variables indicating the IP
* address and PORT to use. If those variables are not available
* (e.g. when you are testing the application on your laptop) then
* use default values of localhost (127.0.0.1) and 33333 (arbitrary).
*/
// var ipaddress = process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1";
// var port = process.env.OPENSHIFT_NODEJS_PORT || 50000;
// // Start listening on the specific IP and PORT
// app.listen(port, ipaddress, function() {
// console.log('%s: Node server started on %s:%d ...',
// Date(Date.now() ), ipaddress, port);
// });
var http = require('http');
var ip = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1',
port = process.env.OPENSHIFT_NODEJS_PORT || '8080';
app.listen(port, ip,function(){
console.log('%s: Node server started on %s:%d ...',
Date(Date.now() ), ip, port);});