TestAPI is a fake online REST API for testing and prototyping.
Route | Method | Description |
---|---|---|
/users | GET | Returns a collection of users |
/users/:id | GET | Return user with the specified id |
/posts | GET | Returns a collection of posts |
/posts/:id | GET | Returns the post with the specified ID |
/postwithuser/:id | GET | Returns the post with the specified ID and the user data |
/products | GET | Returns a collection of products |
/products/:sku | GET | Returns the products with the specified sku |
/restaurants | GET | Returns a collection of restaurant data |
/auth/login | POST | Returns a token for the user |
- Clone this repository
git clone https://github.com/opensource254/mock-api.git
- Navigate into the directory
cd mock-api/
- Install npm(recommended) dependencies
npm i
or with yarnyarn
- Start the dev server with auto reload
npm run dev
or with yarnyarn dev
- Your server is now running at
localhost:3006
the default port be free to change to your desired port.
- Clone this repository
git clone https://github.com/opensource254/mock-api.git
- Navigate into the directory
cd mock-api/
- Install npm(recommended) dependencies
npm i
or with yarnyarn
- npm start.
Your app is now running on
localhost:3006
which is only accessible via LAN to enable WAN access(Not recommended), Editbin/www
change the address from locahost to0.0.0.0
. Your API can now be accessed viayour-ip:3006
.
A better way is to use a reverse proxy with a web server of your choice. I'd recommend nginx.
We love contributions 🤩🤩 Most of the guidelines can be found here for the sake of clarity here is a few guidelines on how to contribute.
- Fork this repository
- Work on your feature
- Create a pull request and let us discuss and review your awesome feature
The API is live here https://mock-api.opensource254.co.ke/