July 2012
Beginner to intermediate
342 pages
7h 27m
English
Development and production code have different requirements. For instance, during development we will most likely want a detailed error output to the client, for debugging purposes. In production, we protect ourselves from opportunistic exploitation by revealing as little internal information as possible.
Express caters to these differences with app.configure which allows us to define environments with specific settings.
We'll need our project folder (nca) from the previous recipe.
Let's take a look at the preconfigured environments:
app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); app.configure('production', function(){ ...Read now
Unlock full access