forked from cloudbees-days/helloworld-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.js
More file actions
22 lines (18 loc) · 623 Bytes
/
hello.js
File metadata and controls
22 lines (18 loc) · 623 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var express = require('express');
var app = express();
var context = process.env.CONTEXT
app.set('view engine', 'pug');
app.use(express.static('public'))
app.set('views', './views');
console.log(process.env.BUILD_NUMBER)
app.get('/', function (req, res) {
console.log('Hello World request.');
res.render('index', { title: 'Hello', message: 'Hello Worlld!',
name: process.env.COMMIT_AUTHOR,
context: context,
buildNumber: process.env.BUILD_NUMBER,
shortCommit: process.env.SHORT_COMMIT})
})
app.listen(8080, function () {
console.log('Example app listening on port 8080!');
});