Giter Club home page Giter Club logo

vercel-typescript-express-api's Introduction

:package: vercel-typescript-express-api

๐Ÿ“ฆ 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

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'

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.

vercel-typescript-express-api's People

Contributors

dependabot[bot] avatar hebertcisco avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vercel-typescript-express-api's Issues

When using an array, even if the array is empty, it is still mandatory to display in the query

Describe the bug
When using an array, even if the array is empty, it is still mandatory to display in the query


export interface ProductInterface {

title: string;
developerName: string;
platform: string[];
fav: string[];

const ProductSchema = new Schema(
platform: {
type:[SchemaTypes.String],
required: false
},
fav: {
type: [SchemaTypes.String],
required: false,
},

When accessed through a browser, an empty array is always displayed forcibly๏ผŒHow not to display empty array?
[{"platform":[],"fav":[],"dir":[],"tag":[],"devicePlatformNames":[],"tagsCaption":[],"name":"็Ÿญๆ–‡1","author":"่Œ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.