Permalink
Browse files

[ ! ] Server Environment Support

  • Loading branch information...
1 parent 2cc0de9 commit 04a62fc2d6f8bfc322e87d74cd1a347cc4b0cc35 @pnegri committed Mar 2, 2012
Showing with 13 additions and 1 deletion.
  1. +12 −0 lib/arcabouco.coffee
  2. +1 −1 package.json
View
@@ -125,13 +125,25 @@ class Arcabouco
localRequirement = require __dirname + "/arcabouco_modules/" + name.toLowerCase()
this[ name ] = new localRequirement()
+ environment: () ->
+ app_environment = process.env.SERVER_ENV
+ if app_environment
+ app_environment = app_environment.toLowerCase()
+ else
+ app_environment = 'development'
+ app_environment
+
# The Application Fabric
# ----------------------
#
# A constructor must be called with a configuration options.
# These configurations can change everything because all
# our functions are just a proxy to internal components.
constructor : ( @config = {} ) ->
+ if @config[@environment()]
+ @config = @config[@environment()]
+
+ console.log @config
# Try to use some user defined packages if they are sent
packages = if @config.packages then @config.packages else {}
View
@@ -1,7 +1,7 @@
{
"name" : "arcabouco-js",
"description" : "scalable microframework in node.js",
- "version" : "0.9.0",
+ "version" : "0.9.1",
"author" : "Patrick Negri <patrick@iugu.com.br>",
"homepage": "http://github.com/pnegri/arcabouco-js",
"contributors" : [],

0 comments on commit 04a62fc

Please sign in to comment.