Skip to content

alexxispn/nest-pokedex

Repository files navigation

NestJS Pokedex

Nest Logo

Stack used

📁 Collection: Pokemon

End-point: Get pokemon

Method: GET

http://localhost:3000/api/pokemon?limit=6&offset=1

Query Params

Param value
limit 6
offset 1

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

End-point: Get pokemon/:term

Method: GET

http://localhost:3000/api/pokemon/63cfca329c1ec789116ec596
http://localhost:3000/api/pokemon/bulbasur
http://localhost:3000/api/pokemon/1

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

End-point: Post pokemon

Method: POST

http://localhost:3000/api/pokemon

Body (raw)

{
    "name": "charmander",
    "no": 4
}

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

End-point: Patch pokemon/:term

Method: PATCH

http://localhost:3000/api/pokemon/63cfca329c1ec789116ec596
http://localhost:3000/api/pokemon/bulbasur
http://localhost:3000/api/pokemon/1

Body (raw)

{
    "name": "bulbasur",
    "no": 1
}

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

End-point: Delete pokemon/:id

Method: DELETE

http://localhost:3000/api/pokemon/63d05c15e9af67f9838506d5

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

End-point: Seed

Method: GET

http://localhost:3000/api/seed

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

Run in development

  1. Clone the repository

    $ git clone https://github.com/alexxispn/nest-pokedex.git
  2. Install NestJS CLI

    $ pnpm add -g @nestjs/cli
  3. Install dependencies

    $ pnpm install
  4. Run the database

    $ docker-compose up -d
  5. Clone the file .env.example and rename it to .env

    $ cp .env.example .env
  6. Set the environment variables

  7. Run the application

    $ pnpm run start:dev
  8. Recreate the data with the seed

    $ http://localhost:3000/api/seed

Run in production

  1. Clone the repository

    $ git clone
  2. Install NestJS CLI

    $ pnpm add -g @nestjs/cli
  3. Install dependencies

    $ pnpm install
  4. Run the database

    $ docker-compose up -d
  5. Clone the file .env.example and rename it to .env.prod

    $ cp .env.example .env.prod
  6. Set the environment variables

  7. Build the image

    $ docker compose -f docker-compose.prod.yaml --env-file .env.prod up --build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published