git clone https://github.com/typescript-tutorial/sql-rest-api.git
cd sql-rest-api
GET: retrieve a representation of the resource
POST: create a new resource
PUT: update the resource
DELETE: delete a resource
[
{
"id" : " spiderman" ,
"username" : " peter.parker" ,
"email" : " peter.parker@gmail.com" ,
"phone" : " 0987654321" ,
"dateOfBirth" : " 1962-08-25T16:59:59.999Z"
},
{
"id" : " wolverine" ,
"username" : " james.howlett" ,
"email" : " james.howlett@gmail.com" ,
"phone" : " 0987654321" ,
"dateOfBirth" : " 1974-11-16T16:59:59.999Z"
}
]
{
"id" : " wolverine" ,
"username" : " james.howlett" ,
"email" : " james.howlett@gmail.com" ,
"phone" : " 0987654321" ,
"dateOfBirth" : " 1974-11-16T16:59:59.999Z"
}
{
"id" : " wolverine" ,
"username" : " james.howlett" ,
"email" : " james.howlett@gmail.com" ,
"phone" : " 0987654321" ,
"dateOfBirth" : " 1974-11-16T16:59:59.999Z"
}
Response: 1: success, 0: duplicate key, -1: error
{
"username" : " james.howlett" ,
"email" : " james.howlett@gmail.com" ,
"phone" : " 0987654321" ,
"dateOfBirth" : " 1974-11-16T16:59:59.999Z"
}
Response: 1: success, 0: not found, -1: error
Request: DELETE /users/:id
Response: 1: success, 0: not found, -1: error