Showing
1 changed file
with
0 additions
and
27 deletions
routes/loginroutes.js
deleted
100644 → 0
1 | -exports.register = function (req, res) { | ||
2 | - // console.log("req", req.body); | ||
3 | - var today = new Date(); | ||
4 | - var users = { | ||
5 | - "UserNo": req.body.UserNo, | ||
6 | - "UserID": req.body.UserID, | ||
7 | - "UserPw": req.body.UserPw, | ||
8 | - "password": req.body.password, | ||
9 | - "created": today, | ||
10 | - "modified": today | ||
11 | - } | ||
12 | - connenction.query('INSERT INTO users SET ?' , users, function (error, results, fields) { | ||
13 | - if (error) { | ||
14 | - console.log("error ocurred", error); | ||
15 | - res.send({ | ||
16 | - "code" : 400, | ||
17 | - "failed": "error ocurred" | ||
18 | - }) | ||
19 | - } else { | ||
20 | - console.log('The solution is: ', results); | ||
21 | - res.send({ | ||
22 | - "code": 200, | ||
23 | - "success": "user registered sucessfully" | ||
24 | - }); | ||
25 | - } | ||
26 | - }); | ||
27 | -} |
-
Please register or login to post a comment