Skip to content

Latest commit

 

History

History
127 lines (82 loc) · 4.04 KB

README.en.md

File metadata and controls

127 lines (82 loc) · 4.04 KB

Project: OpenBanking-Brasil | mock-api

About

This project allows users to run Open Banking Mocked Apis. This mocks are made with OpenAPI Mock Server.

Options to run:

*PWD is a Docker playground which allows users to run Docker commands in a matter of seconds.

Dependencies

Option 1 - Getting started to run on local machine

  1. Download and install Docker and Docker Compose.

  2. Fork this repository on Github.

  3. Clone your forked repository (not our original one) to your hard drive with

git clone https://github.com/YOURUSERNAME/mock-api.git
  1. Access directory mock-api.
cd mock-api
  1. Run the command bellow to start all containers. We have a container for each OpenBankingBrasil API.
docker-compose up

This command will download the images and run the containers with de swagger versions contained in the .env file. By the default this versions is the last published version.

If you want to run all the container with a specific version, please edit the file ".env"

  1. Alternatively is possible to run a docker container individually with the comand below:
docker run -p [PORT:PORT] openbankingbrasil/admin-api:[VERSAO]

[PORT]: Each API-MOCK listen on a specific port as follows:

  • ADMIN_API: "7001"
  • CHANNELS_API: "7002"
  • COMMON_API: "7003"
  • PRODUCTS_SERVICES_API: "7004"

[VERSION]: The version of Open Banking Specification.
Important: This field is required, today we´re not publishing a tag 'latest'.

A example follows below:

docker run -p 7001:7001 openbankingbrasil/admin-api:v1.0.0-rc5.3
  1. Check if mock running typing this URL in your web browser:
https://localhost:7001/open-banking/admin/v1/metrics

Alternatively it's possible check if run using this command to test:

curl https://localhost:7001/open-banking/admin/v1/metrics

If ok, you will see the mocked response:

Figura 1

Option 2 - Getting started to run in the cloud using PWD - Play with Docker

  1. Access PWD and start a new session with your Docker Hub credentials.

Figura 2

  1. Once your session is active click on "Add New Instance".

Figura 3

  1. A new instance will start with a Docker Engine ready to accept commands.

Figura 4

  1. Now run the comand below:
docker run -p 7001:7001 openbankingbrasil/admin-api:v1.0.0-rc5.3

Docker will start to download the images e run the container. At the end, the console will show the message "Starting server on port 7001".

Figura 5

  1. Now you can click on the port 7001 highlighted.

Figura 11

  1. So, you will see a white screen with this message.

Figura 6

  1. Complement the url with the path of one of the API. And you will see the mocked response.

Figura 6

  1. All the API paths can be found on the Open Banking Developer Portal

Figura 7

REFERENCES