Skip to content

Commit

Permalink
Confirm local.json file is present, and update example_local.json fil…
Browse files Browse the repository at this point in the history
…e with port information.
  • Loading branch information
elliotttf committed Jan 30, 2012
1 parent b1e5762 commit e8c5a87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ var form = require('connect-form');
var routes = require('./routes');

if (cluster.isMaster) {
// Make sure the options file is present.
try {
require('fs').statSync('./local.json');
}
catch (error) {
console.error(
'You must create a local.json file with database configuration ' +
'options. See example_local.json for an example.'
);
process.exit(1);
}

// Start the factory!
var factory = new Factory();

Expand Down
1 change: 1 addition & 0 deletions example_local.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"port": 3000,
"database": {
"user": "foo",
"password": "bar",
Expand Down

0 comments on commit e8c5a87

Please sign in to comment.