{"id":16185523,"url":"https://github.com/patrickhulce/mock-api","last_synced_at":"2025-04-07T13:15:39.647Z","repository":{"id":66227415,"uuid":"53024263","full_name":"patrickhulce/mock-api","owner":"patrickhulce","description":"Quick and dirty mock API.","archived":false,"fork":false,"pushed_at":"2016-03-03T05:55:33.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T00:48:46.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/patrickhulce.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,"publiccode":null,"codemeta":null}},"created_at":"2016-03-03T05:43:41.000Z","updated_at":"2016-04-09T17:33:14.000Z","dependencies_parsed_at":"2023-04-02T13:18:38.153Z","dependency_job_id":null,"html_url":"https://github.com/patrickhulce/mock-api","commit_stats":{"total_commits":2,"total_committers":2,"mean_commits":1.0,"dds":0.5,"last_synced_commit":"6b9b06760c4288bc19daf113357c348ab61194f4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fmock-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fmock-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fmock-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fmock-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickhulce","download_url":"https://codeload.github.com/patrickhulce/mock-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657266,"owners_count":20974345,"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":[],"created_at":"2024-10-10T07:14:31.784Z","updated_at":"2025-04-07T13:15:39.622Z","avatar_url":"https://github.com/patrickhulce.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mock-api\nQuick and dirty mock API.\n\n## Usage\n\n### Route Definition Object\nA route definition object outlines what the API response is to be on a given path. Currently supported fields are `path`, `statusCode`, and `body`.\nIf the body value is a string, it will be parsed as a [lodash template](https://lodash.com/docs#template) using the request object as the source.\n\n### Static Routes via File\nEasisest, define route objects in a JSON file.\n\n```json\n{\n  \"/my/static/route\": {\n    \"statusCode\": 201,\n    \"body\": { \"body\": \"to\", \"return\": \"as-is\" }\n  },\n  \"/echo/route\": {\n    \"body\": { \n      \"id\": \"\u003c%= body.id %\u003e\",\n      \"mode\": \"\u003c%= query.my_query_string_value %\u003e\",\n    }\n  }\n}\n```\n\n### Dynamic Routes via POST\nYou can also define routes programmatically via the `/configure` route. Clear all currently set routes with `POST /clear`\n\n`curl -X POST http://localhost:3100/configure -H 'Content-Type: application/json' -d '{\"path\":\"/foo\", \"body\": {\"hello\": \"world\"}}'`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickhulce%2Fmock-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickhulce%2Fmock-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickhulce%2Fmock-api/lists"}