Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.route('/signup')
- .post(function (request,response) {
- var newUser = {
- mail : request.body.email,
- password : hashString(request.body.password)
- }
- usersCollection.insert(newUser, function (err,doc) {
- if (err) throw err;
- response.send(JSON.stringify(doc))
- })
- })
- var hashString = function(string) {
- return crypto.createHash('sha256').update(string).digest('base64')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement