Toggle navigation
Toggle navigation
This project
Loading...
Sign in
고다경
/
Open_Source_project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김태희
2019-06-05 21:59:38 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
986147ecd50371f76e187a0c983f5cbe50855a0f
986147ec
1 parent
745ab445
routes.js 추가
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
routes/loginroutes.js
routes/loginroutes.js
0 → 100644
View file @
986147e
exports
.
register
=
function
(
req
,
res
)
{
// console.log("req", req.body);
var
today
=
new
Date
();
var
users
=
{
"first_name"
:
req
.
body
.
first_name
,
"last_name"
:
req
.
body
.
last_name
,
"email"
:
req
.
body
.
email
,
"password"
:
req
.
body
.
password
,
"created"
:
today
,
"modified"
:
today
}
connenction
.
query
(
'INSERT INTO users SET ?'
,
users
,
function
(
error
,
results
,
fields
)
{
if
(
error
)
{
console
.
log
(
"error ocurred"
,
error
);
res
.
send
({
"code"
:
400
,
"failed"
:
"error ocurred"
})
}
else
{
console
.
log
(
'The solution is: '
,
results
);
res
.
send
({
"code"
:
200
,
"success"
:
"user registered sucessfully"
});
}
});
}
Please
register
or
login
to post a comment