-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
64 lines (44 loc) · 1.59 KB
/
Copy pathserver.js
File metadata and controls
64 lines (44 loc) · 1.59 KB
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
57
58
59
60
61
62
63
64
/*jshint node:true*/
//------------------------------------------------------------------------------
// node.js starter application for Bluemix
//------------------------------------------------------------------------------
// This application uses express as it's web server
// for more info, see: http://expressjs.com
var express = require('express');
// create a new express server
var app = express();
// serve the files out of ./public as our main files
app.use(express.static(__dirname + '/public'));
// set the view engine to ejs
app.set('view engine', 'ejs');
// INDEX page
app.get('/', function(req, res) {
res.render('pages/index');
});
// DOWNLOAD page
app.get('/download', function(req, res) {
res.render('pages/download');
});
// GETSTARTED page
app.get('/getstarted', function(req, res) {
res.render('pages/getstarted');
});
// GETSTARTED -> INSTALL page
app.get('/getstarted/install', function(req, res) {
res.render('pages/install');
});
// GETSTARTED -> CREATE page
app.get('/getstarted/create', function(req, res) {
res.render('pages/create');
});
// GETSTARTED -> BUILD page
app.get('/getstarted/build', function(req, res) {
res.render('pages/build');
});
app.set('port', process.env.OPENSHIFT_NODEJS_PORT || process.env.PORT || 3002);
app.set('ip', process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1");
// start server on the specified port and binding host
app.listen(app.get('port'), app.get('ip'), function() {
// print a message when the server starts listening
console.log("✔ Express server listening at %s:%d ", app.get('ip'),app.get('port'));
});