Vercel Typescript Express Api Save

REST API example to deploy in Vercel(Typescript, Express. MongoDB)

Project README

:package: vercel-typescript-express-api

:package: vercel-typescript-express-api

Rest API example to deploy in Vercel(Typescript, Express. MongoDB)

Did you like the project? Please, considerate being a supporter!

CircleCI

Installation

Clone this repository: git clone https://github.com/hebertcisco/vercel-typescript-express-api

Open the directory and install the dependencies

cd vercel-typescript-express-api
npm install

Running the API

Remember to create an .env file and put your database information. Or run npm run prepare:enviroment to create it.

npm run prepare:enviroment
npm run dev

Calling the API

Get status /

curl --location --request GET 'https://vercel-typescript-express-api.vercel.app/'

Get all product /product

curl --location --request GET 'https://vercel-typescript-express-api.vercel.app/product'

Get a product /product/:productId

curl --location --request GET 'https://vercel-typescript-express-api.vercel.app/product/a328cbb5-9663-4470-88c2-2ac9cc5c4871'

Delete a product/product/:productId

curl --location --request DELETE 'https://vercel-typescript-express-api.vercel.app/product/a328cbb5-9663-4470-88c2-2ac9cc5c4871'

Update a product /product/:productId

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"
}'

Create a product /product

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"
}'

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

Or buy me a coffee 🙌🏾

📝 License

Copyright © 2023 Hebert F Barros.
This project is MIT licensed.

Open Source Agenda is not affiliated with "Vercel Typescript Express Api" Project. README Source: hebertcisco/vercel-typescript-express-api

Open Source Agenda Badge

Open Source Agenda Rating