This project is a simple Express.js API that demonstrates CRUD (Create, Read, Update, Delete) operations for managing a list of books.
- Node.js (v14 or higher)
- npm (Node Package Manager)
-
Clone the repository:
git clone <repository_url>
-
Navigate to the project directory:
cd express-crud-api
-
Install dependencies:
npm install
-
Start the server:
npm start
The server will start and listen on a specified port (default is 3000).
-
Access the API using tools like Postman or
curl
commands. Here are the available endpoints:GET /
: Get a welcome message.GET /livros
: Get the list of books.POST /livros
: Add a new book.PUT /livros/:id
: Update a book's title.DELETE /livros/:id
: Delete a book.
-
Make requests to the API to test the CRUD operations.
-
Endpoint:
/
-
Method:
GET
-
Response:
"Welcome to the Express.js CRUD API!"
- Endpoint:
/livros
- Method:
GET
- Response: