Learning to develop RESTful APIs efficiently using Node.js and Express, integrating MongoDB as the database, and automating the entire end-to-end testing process with Cypress.
Building RESTful APIs with Node.js and Express, structuring routes, and implementing basic CRUD operations.
Learned how to connect the application to MongoDB using Mongoose, as well as model and manipulate data through schemas.
ACreated tests for each API endpoint, focusing on CRUD operations. Explored techniques to simulate and validate API responses.
- Node.js (versão 20.x LTS)
- Visual Studio Code
- Windows Terminal
- Git Bash
Develop a RESTful API in Node.js for a book registration system. The API must include the following features:
📌 Book Registration: Allow users to register books by providing title, author, publisher, publication year, and number of pages. All fields are required. 📌 List Books: Implement an endpoint to list all registered books, returning all their details. 📌 Get Book by ID: Create an endpoint to retrieve a specific book by its ID. 📌 Delete Book: Implement an endpoint to remove a book from the system using its ID. 📌 Database: Use MongoDB as the database.
✅ Use Express.js to manage API routes. ✅ Use Mongoose for data modeling and MongoDB integration. ✅ Include error handling and proper validations for all endpoints. ✅ Add comments in the code to explain key parts of the implementation.
- Clone the repository and install dependencies:
npm install- To start the API, run:
npm start