The server application is the API for the client to access ticket and user data.
When you run yarn start
, the API is available at http://localhost:4200/api.
Request:
GET /api/tickets
Sample Response:
[
{
"id": 1,
"description": "Install a monitor arm",
"assigneeId": 1,
"completed": false
},
{
"id": 2,
"description": "Move the desk to the new location",
"assigneeId": 1,
"completed": false
}
]
Request:
GET /api/tickets/:id
Sample Response:
{
"id": 1,
"description": "Install a monitor arm",
"assigneeId": 1,
"completed": false
}
Request:
GET /api/users
Sample Response:
[
{
"id": 1,
"name": "Alice"
},
{
"id": 2,
"name": "Bob"
},
{
"id": 3,
"name": "Chris"
},
{
"id": 4,
"name": "Daisy"
},
{
"id": 5,
"name": "Ed"
}
]
Request:
GET /api/users/:id
Sample Response:
{
"id": 1,
"name": "Alice"
}
Request:
POST /api/tickets
Request Body:
{
"description": "Install a monitor arm"
}
Sample Response:
{
"id": 1,
"description": "Install a monitor arm",
"assigneeId": null,
"completed": false
}
Request:
PUT /api/tickets/:ticketId/assign/:userId
Response:
204 No Content
Request:
PUT /api/tickets/:ticketId/unassign
Response:
204 No Content
Request:
PUT /api/tickets/:id/complete
Response:
204 No Content
Request:
DELETE /api/tickets/:id/complete
Response:
204 No Content