Welcome to Mocked-API, this is a live API that can be accessed by anyone who needs data to test out their website, app, components etc.
First you should head over to https://api.mocked-api.dev and read our live api docs than start calling the api endpoints for the data you need.
Once you've cloned this repository, running Mocked-API is quite easy, there are just 2 steps you have to follow:
- Install the dependencies
npm run install
- Serve the application
npm run serve
This will show you where the application is running
Mock API is running on port 3000.
- Ensure you have Docker installed
- Open your terminal/command line tool
- Run
docker-compose up
- Open your browser to http://localhost:3000/
Now you should be able to make any request to that port, and get a response back!
π‘ If you browse to that port, you'll see our swagger documentation.
For each module you create you will also need to create a tests folder, Inside this folder there should be a api
and utils
(if you create any utils) folder.
The utils tests are fairly simple jests tests, the api
routes tests are slightly different where you will need to add
const request = require('supertest');
const baseURL = 'http://localhost:3000';
to your tests and make a request in your test instead of calling a normal function.
- Run the mocked api server locally
- run
npm run test
Q: Are you planning to add more end points?
A: I plan to add as many as I can, if there is a specific endpoint of data you would like to see feel free to add a Issue Request.
Please see CHANGELOG for more information what has changed recently.
I encourage you to contribute to Mocked-API! Feel free to fork the codebase and make a pull request for your changes.
Our contributing guide is currently WIP and available here CONTRIBUTING GUIDE
We use semantic commit messages
- feat: (new feature for the user, not a new feature for build script)
- fix: (bug fix for the user, not a fix to a build script)
- docs: (changes to the documentation)
- style: (formatting, missing semi colons, etc; no production code change)
- refactor: (refactoring production code, eg. renaming a variable)
- test: (adding missing tests, refactoring tests; no production code change)
- chore: (updating grunt tasks etc; no production code change)
Do you like this project? Support it by donating.
Buy Me A CoffeeThanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!