Fast Mock is a very simple HTTP server mock, built using Fast API.
Create a mock request
curl --location 'fastmock.your-domain.com:8000/requests/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-token>' \
--data '{
"method": "GET",
"url": "https://example.com/path?param1=foo¶m2=bar",
"status_code": 200,
"response": "{\"test\": 1}"
}'
Response Body
{
"method": "GET",
"status_code": 200,
"id": 1,
"endpoint": "/path",
"parameters": "param1=foo¶m2=bar",
"owner_id": 1,
"url_id": "8f5350fb-f63e-4795-889b-9060916eca75",
"response": {
"test": 1
}
}
Retrieve the mocked response
curl --location '<url-id-from-previous-step>.your-domain.com:8000/path?param1=foo¶m2=bar' \
--header 'Content-Type: application/json'
Response Body
{
"test": 1
}
Clone the project
git clone https://github.com/Jahn16/fast-mock.git
Go to the project directory
cd fast-mock
Install dependencies
pip install -r requirements
Start the server
uvicorn app.main:app