summaryrefslogtreecommitdiffstats
path: root/protoype/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'protoype/app.js')
-rw-r--r--protoype/app.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/protoype/app.js b/protoype/app.js
index 6722eab..2b6828c 100644
--- a/protoype/app.js
+++ b/protoype/app.js
@@ -32,8 +32,10 @@ app.configure(function() {
});
app.post('/create', function(req, res) {
- db.users.save({tag: req.param('tag'), id: req.param('id'), status: "offline", vehicle: '',
- avatar: 'images/avatars/default.png', sig: '', location: '', races: 0},
+ db.users.save({tag: req.param('tag'), id: req.param('id'), status: "offline",
+ vehicle: {make: req.param('make'), model: req.param('model'), year: req.param('year'),
+ desc: req.param('desc')}, userinfo: {sig: req.param('sig')}, location: {loc: req.param('loc')},
+ stats: {matches: 0, won: 0, lost: 0}},
function(err, thing) {
if (err || !thing)
util.log('[create] error saving');
@@ -67,6 +69,9 @@ app.post('/login', function(req, res) {
});
});
+/* /sys/do?get=activelist [list of active users]
+ *
+ */
app.get('/sys/:id([a-z]+)', function(req, res, next) {
/* id contains routing token, req.query is a block/struct, key-val data structure containing GET params
* id should be the main verb, action we want to do */
@@ -81,7 +86,6 @@ app.get('/sys/:id([a-z]+)', function(req, res, next) {
util.log('[sys] do?get=activelist failed or empty');
else {
for (var i = 0; i < result.length; i++) {
- console.log('name is: ' + result[i].tag);
data += result[i].tag + '\n';
}
res.send(data);