aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-03-29 15:30:08 +0100
committerDennis Eriksen <dennis.se@gmail.com>2013-03-29 15:30:08 +0100
commita3887e93387e8f4f3bca478624d10a0316273693 (patch)
tree973ffb67d929718df7a03d8049fa4b499884cf04
parentmade a few changes (diff)
downloadDivid-a3887e93387e8f4f3bca478624d10a0316273693.tar.gz
making signup
Diffstat (limited to '')
-rw-r--r--config/email-settings.js4
-rw-r--r--package.json4
-rw-r--r--router.js24
-rw-r--r--views/signup.ejs4
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 <divid@divid.no>'
+
}
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 @@
</div>
</div>
<div class="form-actions">
- <button type="button" id="account-form-btn1" class="btn"></button>
- <button type="submit" id="account-form-btn2" class="btn"></button>
+ <button type="button" id="account-form-btn1" class="btn">Cancel</button>
+ <button type="submit" id="account-form-btn2" class="btn">Submit</button>
</div>
</fieldset>
</form>