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
| var hpp = require('hpp'); | |
| var express = require('express'); | |
| var bodyParser = require('body-parser'); | |
| var app = express(); | |
| app.use(bodyParser.urlencoded({extended: false})); //body parser should be placed before using hpp | |
| app.use(hpp()); | |
| app.get('/', function(req, res, next){ | |
| console.log('Query Parameters : ' + JSON.stringify(req.query)); |
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
| { | |
| "name": "My App", | |
| "version": "0.0.0", | |
| "scripts": { | |
| "start": "node ./bin/www" | |
| }, | |
| "dependencies": { | |
| "body-parser": "~1.13.2", | |
| "cookie-parser": "~1.3.5", | |
| "debug": "~2.2.0", |
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
| app.use(session({ | |
| name: 'SESS_ID', | |
| secret: process.env.EXPRESS_SESSION_SECRET, | |
| resave: false, | |
| saveUninitialized: true, | |
| cookie: { | |
| secure: true, | |
| httpOnly: true | |
| } | |
| })); |
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
| var express = require('express'); | |
| var http = require('http'); | |
| var app = express(); | |
| /*define routes here*/ | |
| var server = http.createServer(app); | |
| server.listen(80, function(err){ | |
| if (err) { |
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
| angular.module('app') | |
| .controller('MyController', MyController); | |
| MyController.$inject = ['$scope', '$http', '$location']; | |
| function MyController ($scope, $http, $location) { | |
| // write controller function | |
| } |
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
| angular.module('app') | |
| .run(['routeHelper', function(routeHelper){ | |
| routeHelper.configureRoutes(getRoutes()); | |
| }]); | |
| function getRoutes() { | |
| return [ | |
| { | |
| url: '/', | |
| config: { |
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
| // Nodejs encryption with GCM | |
| // Does not work with nodejs v0.10.31 | |
| // Part of https://github.com/chris-rock/node-crypto-examples | |
| var crypto = require('crypto'), | |
| algorithm = 'aes-256-gcm', | |
| password = '3zTvzr3p67VC61jmV54rIYu1545x4TlY', | |
| // do not use a global iv for production, | |
| // generate a new one for each encryption | |
| iv = '60iP0h6vJoEa' |
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
| # mongod.conf | |
| # for documentation of all options, see: | |
| # http://docs.mongodb.org/manual/reference/configuration-options/ | |
| # Where and how to store data. | |
| storage: | |
| dbPath: /var/lib/mongodb | |
| journal: | |
| enabled: true |
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
| security: | |
| authorization: disabled |
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
| security: | |
| authorization: disabled |