Project | Techs | How to contribute
This project is a user CRUD API with an in-memory database built in Node.js without any external libraries.
The project is based on the following technologies:
- 📦 Javascript — Programming language.
- 📦 Node.js — JavaScript runtime environment.
- 📦 Restful concepts — Architectural style for APIs.
Install Node.js 18 and run the following command:
npm run dev
curl --request GET --url http://localhost:3333/users
Response code 200 and click here to see the response body
[
{
"id": "8bc91d7d-1733-4fc8-a280-f3723d5f9a03",
"name": "John Doe",
"email": "john.doe@gmail.com"
},
{
"id": "1bc91d7d-1733-4fc8-a280-f3723d5f9a06",
"name": "John Doe 2",
"email": "john.doe2@gmail.com"
}
]
curl --request POST --url http://localhost:3333/users --header 'Content-Type: application/json' --data '{"name": "John Doe", "email": "john.doe@gmail.com"}'
Response code 201 and click here to see the request body
{
"name": "John Doe",
"email": "jjjj"
}
If you want to search for an specific user, you can use the query param search
:
curl --request GET --url 'http://localhost:3333/users?search=John Doe'
There is no response body for this request.
curl --request PUT --url http://localhost:3333/users/8bc91d7d-1733-4fc8-a280-f3723d5f9a03 --header 'Content-Type: application/json' --data '{"name": "John Doe 2", "email": "john2.doe@gmail.com"}'
Response code 204 and click here to see the request body
{
"email": "updatedmail",
"name": "updated name"
}
There is no response body for this request.
curl --request DELETE --url http://localhost:3333/users/8bc91d7d-1733-4fc8-a280-f3723d5f9a03
Response code 204, there is no request/response body for this request.
- Fork this repository;
- Create a new branch with your feature:
git checkout -b feature/my-feature
; - Commit your changes:
git commit -m 'feat: awesome feature'
; - Push to your branch:
git push origin feature/my-feature
.
Once your pull request has been merged, you can delete your branch.
Made with 💙 & ☕ by João Bispo😎