axeleguia / ms-trx-nest

Nestjs API - Swapi - DynamoDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

Description

Nest server to consume Swapi API and Internal DB.

  1. Write an HTTP GET method to retrieve all information from the planets and people databases from SWAPI with a limit param. For example, if parameter A is 5, you will get only 5 elements of the total. Consider not using the internal database, but get the data directly from SWAPI.
  2. Write an HTTP GET method to retrieve information from the planets databases from SWAPI and save information in a internal database.
  3. Write an HTTP GET method to retrieve information from people databases from SWAPI and save information in a internal database.
  4. Write an HTTP POST method to save any information about people in your database.

Below are the endpoints that you will implement:

INFO METHOD URL
GET PLANETS WITH LIMIT GET :baseURL/api/planets?limit=:limit
GET PEOPLE WITH LIMIT GET :baseURL/api/people?limit=:limit
GET ANY PLANET BY ID GET :baseURL/api/planets/:planetId
GET ANY PERSON BY ID GET :baseURL/api/people/:personId
POST ANY PERSON POST :baseURL/api/people

Diagram:

Demo

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Testing API

Run npm run start for a dev server. Navigate to http://localhost:3000/. The application will show Swagger API docs.

Demo

Stay in touch

About

Nestjs API - Swapi - DynamoDB


Languages

Language:TypeScript 96.3%Language:JavaScript 3.2%Language:Shell 0.5%