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.
If you would like to contribute during Hacktoberfest please following our contribution guidelines (Which we are still working on) but here is a quick summary of what we expect in the process of dev to raising your PR.
- Find a ticket and ask to be assigned, once assigned start work. :) This is so we don't get multiple PR's for the same issue.
- Please branch from our active next release dev
- Please make sure your new endpoints all have OpenAPI Comments as they will be used to generate our swagger documentation.
- Please make sure you have added unit tests for end points and util functions.
- MOST importantly, have fun.
If you need help, please leave a comment on the ticket you are assigned to our join our discord by clicking the link below.
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 install
- Configure the application
An example configuration file
.env.example
is provided.
npm run config
- 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
import request from 'supertest';
import app from 'path/to/app';
to your tests and make a request in your test instead of calling a normal function.
run npm test
run npm run test:watch
to run the tests in watch mode.
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!