Skip to content
Browse files

Add production/development modes

  • Loading branch information...
1 parent 91e1e45 commit 3cc6d21fdf621332a8a9858381608440a41bbb06 @jacobrask committed Jan 10, 2012
Showing with 12 additions and 2 deletions.
  1. +5 −1 bragi.js
  2. +7 −1 lib/db.coffee
View
6 bragi.js
@@ -1,4 +1,8 @@
-#!/usr/bin/env node-dev
+#!/usr/bin/env node
+
+if (process.env.NODE_ENV == null || process.env.NODE_ENV === undefined) {
+ process.env.NODE_ENV = 'production';
+}
require('coffee-script');
require('./lib/index');
View
8 lib/db.coffee
@@ -5,7 +5,13 @@ _ = require './utils'
{ Db, Connection, Server, BSONPure: { ObjectID } } = require 'mongodb'
-db = new Db 'bragi-mediaserver',
+dbName =
+ if process.env.NODE_ENV is 'production'
+ 'bragi-mediaserver'
+ else
+ 'bragi-mediaserver-dev'
+
+db = new Db dbName,
new Server 'localhost',
Connection.DEFAULT_PORT

0 comments on commit 3cc6d21

Please sign in to comment.
Something went wrong with that request. Please try again.