Guided project for Node API 1 Module.
In this project we will learn how to create a simple Web API using Node.js
and Express
.
- Clone this repository.
- Open the project folder in VSCode.
Build a RESTful Web API for an animal shelter to Create, Read, Update and Delete dogs.
A Dog has:
- a unique
id
. - a
name
. - a
weight
.
The Web API must provide a set of endpoints
to fulfill the following needs:
- add a new Dog.
- view a list of existing Dogs.
- view the details of a single Dog.
- update the information of an existing Dog.
- remove a Dog.
Here is a table with the endpoint
descriptions:
Action | URL | Method | Response |
---|---|---|---|
Add a Dog | /api/dogs | POST | the new Dog |
View list of Dogs | /api/dogs | GET | array of Dogs |
View Dog details | /api/dogs/{id} | GET | a Dog |
Update Dog | /api/dogs/{id} | PUT | updated Dog |
Remove a Dog | /api/dogs/{id} | DELETE | deleted Dog |