Dockerized Fake server toolkit for development and testing
API_PATH = "/api",
Create ./__mocks__/config.yml
rest:
- path: /login
method: post
validate:
body:
email: 'test@test.com'
password: 'my-password'
success: login.success
error: 401.error
- path: /users
success: users.success
error: 401.error
validate:
queryString:
token: my-secret
- path: /avatar
multiPart: true
files:
- name: avatar
maxCount: 1
- name: gallery
maxCount: 8
-path: Endpoint you want to mock
method: (Default: GET) HTTP Method
validate: (Optional)
_body_: Object with values to validate for success
_queryString_: Object with values to validate for success
success: (Optional) Name of the yaml file that has the blueprint for the success payload
error: (Optional) Name of the yaml file that has the blueprint for the error payload
multiPart: (Optional) List of InputFiles to emulate
name: name
of your InputFile maxCount: Max amount of files allowed on the
queue
version: '3'
services:
app:
build: .
ports:
- 80:80
environment:
- API_URL=http://localhost:3000/my-rest-api
fake-server:
image: thankyoupayroll/fake-server
environment:
- REST_API_PATH=/my-rest-api
ports:
- 3000:3000
volumes:
- './__mocks__/:/workspace/responses'
- REST
- MultiPart Upload (Experimental)
- Stream
- WebSocket
- GraphQL