This file contains 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
Verifying myself: My Bitcoin username is +matmar10. https://onename.io/matmar10 |
This file contains 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
[ | |
{ | |
"step": "ADD_ADDRESS", | |
"points": 2 | |
}, | |
{ | |
"step": "ADD_MOBILE", | |
"points": 3 | |
}, | |
{ |
This file contains 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.post('/user/:id', function (req, res) { | |
User.findOne({_id: ObjectId(req.params.id)}, function (err, user) { | |
validator.run(rules, req.body, function (errorCount, errors) { | |
user.merge(req.body); | |
user.save(function(err, savedUser) { | |
EmailClient.sendEmail(user.email, 'Your account was updated', function (err) { | |
res.status(200).send({ | |
message: 'User updated' | |
}); | |
}); |
This file contains 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.post('/user/:id', | |
lookupUser, | |
validatePostBody, | |
mergeUser, | |
saveUser, | |
sendUserUpdatedEmail, | |
returnSuccess); |
This file contains 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 strict'; | |
module.exports = function (grunt) { | |
// load all configured grunt tasks | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
bowerUpdateMain: { |
This file contains 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 lookupUser, validateBody, mergeUser, saveUser, sendUserUpdatedEmail, returnSuccess; | |
lookupUser = function (req, res, next) { | |
User.findOne({ | |
_id: new ObjectId(req.params.id) | |
}, function (err, user) { | |
if (err) { | |
res.status(500).send(err); | |
return; | |
} |
This file contains 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 sendEmailMiddleware = require('./middleware/send-email'); | |
app.post('/user/:id', | |
passport.authenticate('bearer'), | |
lookupUser, | |
validatePostBody, | |
mergeUser, | |
saveUser, | |
sendEmailMiddleware('user-updated'), | |
returnSuccess); |
This file contains 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
module.exports = [ | |
"./plugins/user", | |
"./plugins/business" | |
]; |
This file contains 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
/src/ | |
+-- app.js | |
+-- architect-config.js | |
+-- plugins/ | |
+-- business/ | |
+-- index.js | |
+-- package.json | |
+-- user/ | |
+-- user.js | |
+-- package.json |
This file contains 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 strict'; | |
var architect = require('architect'); | |
var path = require('path'); | |
architect.loadConfig(path.join(__dirname, 'config.js'), function (err, architectConfig) { | |
if (err) { | |
console.error('Could not create Architect config:', err); | |
process.exit(1); | |
return; |
OlderNewer