Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[ ! ] Server Environment Support

  • Loading branch information...
commit 04a62fc2d6f8bfc322e87d74cd1a347cc4b0cc35 1 parent 2cc0de9
@pnegri authored
Showing with 13 additions and 1 deletion.
  1. +12 −0 lib/arcabouco.coffee
  2. +1 −1  package.json
View
12 lib/arcabouco.coffee
@@ -125,6 +125,14 @@ 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
# ----------------------
#
@@ -132,6 +140,10 @@ class Arcabouco
# 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
2  package.json
@@ -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" : [],
Please sign in to comment.
Something went wrong with that request. Please try again.