{"id":23683991,"url":"https://github.com/januschung/mock-flask","last_synced_at":"2026-04-15T14:35:43.594Z","repository":{"id":225598640,"uuid":"655914610","full_name":"januschung/mock-flask","owner":"januschung","description":"A simple mock server create with Python Flask","archived":false,"fork":false,"pushed_at":"2024-03-03T06:06:44.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T20:32:40.833Z","etag":null,"topics":["blueprint","docker","docker-compose","flask","gunicorn","mock","mock-server","python","restful-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/januschung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-19T22:12:16.000Z","updated_at":"2023-06-25T05:09:53.000Z","dependencies_parsed_at":"2024-03-03T06:22:20.978Z","dependency_job_id":"3ebaf311-b4b6-4d92-a8fb-9f763477e7bc","html_url":"https://github.com/januschung/mock-flask","commit_stats":null,"previous_names":["januschung/mock-flask"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/januschung%2Fmock-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/januschung%2Fmock-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/januschung%2Fmock-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/januschung%2Fmock-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/januschung","download_url":"https://codeload.github.com/januschung/mock-flask/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239735864,"owners_count":19688355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blueprint","docker","docker-compose","flask","gunicorn","mock","mock-server","python","restful-api"],"created_at":"2024-12-29T20:31:43.606Z","updated_at":"2026-01-06T05:30:19.147Z","avatar_url":"https://github.com/januschung.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Introduction\n\nThis is a simple REST mock server written with Python `3.12` and Flask `3.0.2`. It also comes with Gunicorn which enables hot reload for local development.\n\nIt provides sample endpoints to render output either based on static resource file or simple logic as defined in `mock.py`.\n\nThe server can either be brought up as a standalone python application or as a docker.\n\nFeel free to provide feedback or feature request.\n\n\n#### Customize the Mock Service\n\nFor the resouce endpoint, You can modify the return value by adding a new file or editing the file under `static` folder.\n\n\n#### Available Endpoints:\n\n\n\u003cdetails\u003e\n\u003csummary\u003e/resource/[value]\u003c/summary\u003e\n\nThis mock service returns static response from the file located in `src/main/resources/data`\n\n\n_Sample 1_\n\n**curl \"http://localhost:5000/resource/100\"**\n\n\nwill return \n\n```console\n[\n {\"id\":\"100\",\"name\":\"jack\",\"age\":\"30\"},\n {\"id\":\"101\",\"name\":\"jill\",\"age\":\"32\"}\n]\n```\n\n_Sample 2_\n\n**curl \"http://localhost:5000/resource/200\"**\n\n\nwill return\n\n```console\n[\n {\"id\":\"200\",\"name\":\"tom\",\"age\":\"40\"},\n {\"id\":\"201\",\"name\":\"jerry\",\"age\":\"28\"}\n]\n```\n\nWhen request with a non existing file, the response will be reading from file `empty`\n\n_Sample 3_\n\n**curl \"http://localhost:5000/resource/300\"**\n\n\nwill return\n\n```console\n[]\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e/http_status/[value]\u003c/summary\u003e\n\n_Sample 1_\n\n\n**curl \"http://localhost:5000/http_status/200\"**\n\n\nwill return status code 200 and the following response\n\n```console\n200 OK\n```\n\n_Sample 2_\n\n**curl \"http://localhost:5000/http_status/400\"**\n\n\nwill return status code 400 and the following response\n\n```console\n400 BAD_REQUEST\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e/delay/[value]\u003c/summary\u003e\n\n_Sample 1_\n\n\n**curl \"http://localhost:5000/delay/3000\"**\n\n\nwill return response with 3000 milliseconds delay\n\n```console\nResponse with delay of 3000 milliseconds\n```\n\u003c/details\u003e\n\n#### Build and run\n```console\ncd app\ngunicorn --reload --bind localhost:3000 \"app:app\"\n```\n\n#### Build and run with docker\n```console\ncd app\ndocker build -t mock-flask .\ndocker run -p 9000:80 mock-flask\n```\n\n#### Build and run with docker-compose\n```console\ndocker-compose up -d\n```\n\n## Contributing\nI appreciate all suggestions or PRs which will help making the mock better. Feel free to fork the project and create a pull request with your idea.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanuschung%2Fmock-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanuschung%2Fmock-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanuschung%2Fmock-flask/lists"}