A simple mock API server using Express.js that is hosted on Firebase.
You have full control of what API to define and what data to respond with with minimal coding.
The APIs are defined via Express.js framework and served though Firebase cloud functions. All the defined API can be found at functions/index.js and pre-loaded mock responses example can be found at mock-responses.
- References: https://expressjs.com/en/guide/routing.html
-
Hello!
https://maxsoft-mock-server-demo.web.app/say/hello?name=Osanda -
Get User Details
https://maxsoft-mock-server-demo.web.app/users/1 -
Get large list of photos response from mocked JSON file
https://maxsoft-mock-server-demo.web.app/photos -
Get a single photo item from mocked JSON file
https://maxsoft-mock-server-demo.web.app/photos/29647
- Register a new user
Success
curl -X POST \
https://maxsoft-mock-server-demo.web.app/register \
-H 'Content-Type: application/json' \
-d '{"userId": "myusername", "email":"my@email.com", "name": "New User"}'
Fail
curl -X POST \
https://maxsoft-mock-server-demo.web.app/register \
-H 'Content-Type: application/json' \
-d '{"userId": "existingId", "email":"osanda.deshan@gmail.com", "name": "Existing User"}'
NOTE: You will have to use terminal to execute these curl commands or you can import postman collection