Implementing the Teams API

Before we start coding, we have to design our API first. The following table contains the documentation for the API we will implement:

Route HTTP Verb Goal Responses
/teams GET List all the teams Http 200 - OK
/teams POST

Create a new team with body

{name: String}

Http 201 - Created
/teams/:id GET Get a single team

Http 200 -OK

Http 404 - Not Found

/teams/:id PUT Update an existing team

Http 200 -OK

Http 404 - Not Found

/teams/:id DELETE Delete an existing team

Http 200 -OK

Http 404 - Not Found

 

Keeping this in mind, let's begin with the fun part!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset