Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // all environments
  2. app.configure(function()
  3. {
  4. app.use(express.static(__dirname + '/public'));
  5. // ...
  6. });
  7.  
  8. // NODE_ENV=development only
  9. app.configure('development', function()
  10. {
  11. app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
  12. // ...
  13. });
  14.  
  15. // NODE_ENV=production only
  16. app.configure('production', function()
  17. {
  18. app.use(express.errorHandler());
  19. // ...
  20. });
  21.  
  22. app.configure('development', function() {
  23. // configure stuff here
  24. });
  25. // becomes
  26. var env = process.env.NODE_ENV || 'development';
  27. if ('development' == env) {
  28. // configure stuff here
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement