Example using tshield as offline api mock
This example use Node.js and Ruby
To get started, install the bundler:
gem install bundler
Then you should be able to run the following command to prepare your environment:
bundle install
Now run tshield to start mock server
tshield
Run the following command to prepare your environment:
npm i
To run with tshield mock server run the following command
npm run start-mock
To run without mock run the following command
npm run start
After start mock-server and client-api access swagger interface for testing requests:
http://localhost:8080/api-docs
For this example the valid filters are:
- hulk
- spider-man
- spider man
For other filters you need to config Marvel and Tenor API keys for valid authorization.
After get valid API keys start application with this env vars:
- MARVEL_API_PRIVATE_KEY
- MARVEL_API_PUBLIC_KEY
- TENOR_API_KEY
Example:
MARVEL_API=http://localhost:4567 \
TENOR_API=http://localhost:4567 \
MARVEL_API_PRIVATE_KEY=<<private-key>> \
MARVEL_API_PUBLIC_KEY=<<pubic-key>> \
TENOR_API_KEY=<<key>> \
npm run start