From a3887e93387e8f4f3bca478624d10a0316273693 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 29 Mar 2013 15:30:08 +0100 Subject: making signup --- config/email-settings.js | 4 +++- package.json | 4 +++- router.js | 24 +++++++++++++++++++++++- views/signup.ejs | 4 ++-- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/config/email-settings.js b/config/email-settings.js index ce65fe3..8bc9983 100644 --- a/config/email-settings.js +++ b/config/email-settings.js @@ -2,10 +2,12 @@ * Email settings */ -module.exports { +module.exports = { + host: 'localhost', user: 'divid', password: '', sender: 'Divid ' + } diff --git a/package.json b/package.json index b244bc5..7325e5c 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "ejs": "*", "mongoose": "*", "connect": "*", - "emailjs": "*" + "emailjs": "*", + "mongodb": "*", + "moment": "*" } } 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 diff --git a/views/signup.ejs b/views/signup.ejs index 44579fe..b64845b 100644 --- a/views/signup.ejs +++ b/views/signup.ejs @@ -284,8 +284,8 @@
- - + +
-- cgit v1.2.3