Skip to content

Commit c062fb0

Browse files
author
Siraj Rauff
committed
Prepping example for Workshop Example
1 parent 1f6c89b commit c062fb0

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

dev-config.json

-4
This file was deleted.

habitat/config/config.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"title": "{{ cfg.title }}",
3-
"message": "You are running version {{ pkg.version }} of the Habitat Node.js sample app."
3+
"message": "You are running version {{ pkg.version }} of the Habitat Node.js sample app.",
4+
"port": {{ cfg.port }}
45
}

habitat/default.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
# https://www.habitat.sh/docs/developing-packages/#add-configuration.
66

77
title = "Habitat - The fastest path from code to cloud native."
8+
port = 8000

index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
var app = require('./app');
22
var http = require('http');
3-
var port = process.env.PORT || 8000;
3+
var nconf = require('nconf');
44

5+
nconf.file({ file: process.argv[2] });
6+
7+
var port = nconf.get('port');
58
app.set('port', port);
69

710
var server = http.createServer(app);

public/stylesheets/style.css

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
body {
44
font-family: "Titillium Web", Helvetica, Arial, sans-serif;
55
color: #FFFFFF;
6+
/* background-color: #a3c1ad; */
67
background-color: #243442;
78
margin: 0;
89
}

routes/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var nconf = require('nconf');
77
// for dynamic configuration, so we'll pass as an argument the path
88
// to the config file that Habitat will render for us on startup.
99
// See ./habitat/hooks/run for the implementation details.
10-
nconf.file({ file: process.argv[2] || './dev-config.json' });
10+
nconf.file({ file: process.argv[2] });
1111

1212
router.get('/', function(req, res, next) {
1313
res.render('index', {

0 commit comments

Comments
 (0)