From a3887e93387e8f4f3bca478624d10a0316273693 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 29 Mar 2013 15:30:08 +0100 Subject: making signup --- router.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'router.js') diff --git a/router.js b/router.js index 3d9558c..ef95309 100644 --- a/router.js +++ b/router.js @@ -1,5 +1,6 @@ - +var AM = require('./modules/account-manager'); +var EM = require('./modules/email-dispatcher'); @@ -51,6 +52,27 @@ module.exports = function(app) { }); + /* POST */ + + app.post('/signup', function(req, res) { + AM.addNewAccount({ + name : req.param('name'), + email : req.param('email'), + user : req.param('user'), + pass : req.param('pass'), + country : req.param('country') + }, function(e) { + if (e) { + res.send(e, 400); + } else { + res.send('ok', 200); + } + }); + }); + + + + /* * ERRORS -- cgit v1.2.3