- Don't run as root.
- For sessions, set
httpOnly(andsecuretotrueif running over SSL) when setting cookies. - Use the Helmet for secure headers: https://github.com/evilpacket/helmet
- Enable
csrffor preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf - Don't use the deprecated
bodyParser()and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use thedeferproperty andpipe()the multipart upload stream to the intended destination.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // use like this: | |
| // process.emit( 'app:log', module, arg1, arg2, ..., argN ); | |
| var Module = require('module'); | |
| function logConsole(method, module) { | |
| var args = [(new Date()).toJSON(), method]; | |
| var index = 1; | |
| if (module instanceof Module) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define([ | |
| 'jquery', | |
| 'underscore', | |
| 'backbone', | |
| 'marionette', | |
| 'handlebars', | |
| 'text!templates/app_view.html', | |
| 'modules/mainMenuView/mainMenuView', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://jsfiddle.net/suBPQ/ | |
| $.ajax({ | |
| url: "http://api_test_server.proudlygeek.c9.io/", | |
| success: function(data) { | |
| console.log(data); | |
| } | |
| }); |