Unexpected "npm command not found" error received, but I did not uninstall npm and Node is installed and returning it's correct version
brew install yarn
// testing userAgent HTML5 constraints | |
// is userAgent Safari && webkitVersion 603 or higher | |
// https://webkit.org/blog/7099/html-interactive-form-validation/ | |
<script> | |
var isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) | |
var interactiveFormValidationEnabled = false | |
var appVersion = navigator.appVersion | |
var webkitVersion1 = appVersion.indexOf('AppleWebKit/') + 12 |
// my authentication modifications to book 'Getting MEAN' | |
// repository: https://github.com/simonholmes/getting-MEAN | |
// file: './app_api/controllers/authentication.js' | |
var passport = require('passport'); | |
var mongoose = require('mongoose'); | |
var User = mongoose.model('User'); | |
var sendJSONresponse = function(res, status, content) { |
// my authentication modifications to book 'Getting MEAN' | |
// repository: https://github.com/simonholmes/getting-MEAN | |
// file: './app_api/config/passport.js' | |
var passport = require('passport'); | |
var LocalStrategy = require('passport-local').Strategy; | |
var mongoose = require('mongoose'); | |
var User = mongoose.model('User'); |
// my authentication modifications to book 'Getting MEAN' | |
// repository: https://github.com/simonholmes/getting-MEAN | |
// file: './app_api/models/users.js' | |
var mongoose = require( 'mongoose' ); | |
var crypto = require('crypto'); | |
var jwt = require('jsonwebtoken'); | |
var userSchema = new mongoose.Schema({ |
// Send Node.js Error object properties, including 'stack', in a JSON response | |
// A existing Error object is passed to below module and a new object with properties is returned | |
// To create a custom Error object first use 'customErrorObject.js' module below, then pass to below module | |
module.exports = function (errorObject) { | |
var newObjectErrorEnumerable = {} | |
Object.keys(errorObject).forEach(function (k) { |
/* | |
req.body.template = {displayname: 'required', | |
email: 'required', | |
confirmEmail: 'required', | |
password: 'required', | |
confirmPassword: 'required', | |
firstname: 'required', | |
lastname: 'required', | |
city: 'required', |
var mongoose = require('mongoose') | |
var User = mongoose.model('User') | |
module.exports = function (req, res, cb) { | |
var expectedResponse = req.body.expectedResponse | |
!expectedResponse ? expectedResponse = req.body.template.expectedResponse : null | |
var email = req.body.email.trim() |
// 'Cancel' button on a Bootstrap Modal form | |
// This simply cancels active input events when user cancels a form | |
// Note data-dismiss="modal" since this button is child of form element. It prevents form submission and hides Modal | |
// button(class="btn btn-default btn-md", data-dismiss="modal", id="newUserDataItemModalCancel") Cancel | |
// Turn Off Selected Events: | |
turnOffSpecificEvents: function () { | |
$('#newUserDataItem').off('change') |
If you are working with a REST API and have not seen Microsoft's REST API Guidelines doc, you should check this out.
https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md