Basic NodeJS - Express - MongoDB REST API
curl --location 'http://localhost:3002/item'
curl --location 'http://localhost:3002/item/:id'
curl --location 'http://localhost:3002/item' \
--header 'Content-Type: application/json' \
--data '{
"name": "Model Y",
"color": "Blue",
"gas": "gasoline",
"year": 2023,
"description": "Comfort line V8",
"price": 43000
}'
curl --location --request PUT 'http://localhost:3002/item/:id' \
--header 'Content-Type: application/json' \
--data '{
"name": "Model X",
"color": "Gray",
"gas": "gasoline",
"year": 2023,
"description": "Trend line Sedan Turbo",
"price": 23000
}'
curl --location --request DELETE 'http://localhost:3002/item/:id'
curl --location 'http://localhost:3002/auth/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "zvx",
"password": "12345",
"email": "zvx@gmail.com"
}'
curl --location 'http://localhost:3002/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "zvx@gmail.com",
"password": "12345"
}'
curl --location 'http://localhost:3002/order' \
--header 'Authorization: Bearer example.bearer.token'