forked from cloudfoundry-samples/cf-sample-app-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
25 lines (22 loc) · 876 Bytes
/
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
var express = require( 'express')
var app = express()
var cf_app = require( './app/vcap_application')
var cf_svc = require( './app/vcap_services')
app.set( 'views', __dirname + '/views')
app.set( 'view engine', 'pug')
app.use( express.static( __dirname + '/public'))
app.get( '/', function ( req, res) {
res.render( 'pages/index', {
app_environment: app.settings.env,
application_name: cf_app.get_app_name(),
app_uris: cf_app.get_app_uris(),
app_space_name: cf_app.get_app_space(),
app_index: cf_app.get_app_index(),
app_mem_limits: cf_app.get_app_mem_limits(),
app_disk_limits: cf_app.get_app_disk_limits(),
service_label: cf_svc.get_service_label(),
service_name: cf_svc.get_service_name(),
service_plan: cf_svc.get_service_plan()
})
})
app.listen( process.env.PORT || 4000)