Rest API example to deploy in Vercel(Typescript, Express. MongoDB)
Did you like the project? Please, considerate being a supporter!
Clone this repository:
git clone https://github.com/hebertcisco/vercel-typescript-express-api
cd vercel-typescript-express-api
npm install
Remember to create an
.env
file and put your database information. Or runnpm run prepare:enviroment
to create it.
npm run prepare:enviroment
npm run dev
curl --location --request GET 'https://vercel-typescript-express-api.vercel.app/'
curl --location --request GET 'https://vercel-typescript-express-api.vercel.app/product'
curl --location --request GET 'https://vercel-typescript-express-api.vercel.app/product/a328cbb5-9663-4470-88c2-2ac9cc5c4871'
curl --location --request DELETE 'https://vercel-typescript-express-api.vercel.app/product/a328cbb5-9663-4470-88c2-2ac9cc5c4871'
curl --location --request PUT 'https://vercel-typescript-express-api.vercel.app/product/a328cbb5-9663-4470-88c2-2ac9cc5c4871' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Apple iPhone 11 (64 GB) (PRODUCT) RED",
"slug": "Apple-iPhone-11-64-GB-PRODUCT-RED",
"quantity": 1,
"image": "https://m.media-amazon.com/images/I/715HCLsOHbL._AC_SX679_.jpg",
"price": "299845",
"description": "Repudiandae iure animi esse minus dolorem earum et. Eligendi in fugit. Dolor odio est harum veritatis error.",
"guarantee": "Sem garantia",
"brand": "Apple",
"model": "11"
}'
curl --location --request POST 'https://vercel-typescript-express-api.vercel.app/product' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Apple iPhone 11 (64 GB) (PRODUCT) RED",
"slug": "Apple-iPhone-11-64-GB-PRODUCT-RED",
"quantity": 1,
"image": "https://m.media-amazon.com/images/I/715HCLsOHbL._AC_SX679_.jpg",
"price": "299845",
"description": "Repudiandae iure animi esse minus dolorem earum et. Eligendi in fugit. Dolor odio est harum veritatis error.",
"guarantee": "Sem garantia",
"brand": "Apple",
"model": "11"
}'
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Or buy me a coffee 🙌🏾
Copyright © 2023 Hebert F Barros.
This project is MIT licensed.