{"id":20607957,"url":"https://github.com/cashoefman/mockend-rest-api-example","last_synced_at":"2026-03-19T16:41:26.555Z","repository":{"id":144776308,"uuid":"531347609","full_name":"cashoefman/Mockend-Rest-API-Example","owner":"cashoefman","description":"This is an example of how to use Mockend to quickly setup a REST API","archived":false,"fork":false,"pushed_at":"2022-09-08T19:10:05.000Z","size":663,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T16:57:20.758Z","etag":null,"topics":["api","mock","rest-api"],"latest_commit_sha":null,"homepage":"","language":null,"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/cashoefman.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":"2022-09-01T03:24:00.000Z","updated_at":"2022-09-01T03:49:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"09276ca2-ec1d-497c-9860-021ff06761a4","html_url":"https://github.com/cashoefman/Mockend-Rest-API-Example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cashoefman/Mockend-Rest-API-Example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashoefman%2FMockend-Rest-API-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashoefman%2FMockend-Rest-API-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashoefman%2FMockend-Rest-API-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashoefman%2FMockend-Rest-API-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cashoefman","download_url":"https://codeload.github.com/cashoefman/Mockend-Rest-API-Example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashoefman%2FMockend-Rest-API-Example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013695,"owners_count":26085390,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","mock","rest-api"],"created_at":"2024-11-16T10:09:04.792Z","updated_at":"2025-10-13T05:13:44.534Z","avatar_url":"https://github.com/cashoefman.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mockend-Rest-API-Example\n\n### This is an example of how to use Mockend to quickly setup a REST API\n\nToday I was goofing around with some development tools and I needed a simple REST API to do a little bit of testing. I really enjoy working with tools that make my life easier and I've written about [tools like this](https://github.com/cashoefman/my-heroku-api-server) before.\n\nThis time around we are going to look at how to use [Mockend](https://mockend.com/) to quickly setup a REST API. Note this is a paid service but there is a free version for personal use.\n\nTo get started, go to https://github.com/marketplace/mockend and click on the \"Setup a plan\" button.\n\n![Mockend Setup](images/Mockend-1.jpg)\n\nSelect the free plan and click on \"Install it for free\"! If you are already signed into your Github Account it will automatically use that or it will ask you to login to GitHub.\n\n![Mockend Setup](images/Mockend-2.jpg)\n\nNext you click on \"Complete order and begin installation\" and then two last steps \"Install \u0026 Authorize\" and enter your TFA code and you are in business.\n\n![Mockend Setup](images/Mockend-3.jpg)\n\nNow in your project repo create a .mockend.json file with the following basic config on your repo:\n\n    github.com/YourName/YourRepoName/.mockend.json \n\nIn my example that would be something like:\n\n    github.com/cashoefman/Mockend-Rest-API-Example/.mockend.json \n\n\n    {\n      \"User\": {\n        \"title\": { \"string\": {} }\n      }\n    }\n\n## Try your new mock server:\n\n### 1. List your fake users with a GET request\n    curl https://mockend.com/YourName/YourRepoName/users\n\nIn my example that is:\n\n    curl https://mockend.com/cashoefman/Mockend-Rest-API-Example/Users\n\n### 2. Fake a creation with a POST\n##### (don't worry changes aren't persisted)\n    curl https://mockend.com/\u003cYourName\u003e/\u003cYourRepoName\u003e/users \\\n      -X POST \\\n      -H \"Content-Type: application/json\" \\\n      --data '{\"name\": \"alice\"}'\n\n### 3. Access your GraphQL endpoint\n    https://mockend.com/YourName/YourRepoName/graphql\n\nTest other random generators with this config:\n\n    github.com/YourName/YourRepoName/.mockend.json\n\n    {\n      \"User\": {\n        \"name\": {\n          \"string\": {}\n        },\n        \"avatarUrl\": {\n          \"regexp\": \"https://i\\\\.pravatar\\\\.cc/150\\\\?u=[0-9]{5}\"\n        },\n        \"statusMessage\": {\n          \"string\": [\n            \"working from home\",\n            \"watching Netflix\"\n          ]\n        },\n        \"email\": {\n          \"regexp\": \"#[a-z]{5,10}@[a-z]{5}\\\\.[a-z]{2,3}\"\n        },\n        \"color\": {\n          \"regexp\": \"#[0-9A-F]{6}\"\n        },\n        \"age\": {\n          \"int\": {\n            \"min\": 21,\n            \"max\": 100\n          }\n        },\n        \"isPublic\": {\n          \"boolean\": {}\n        }\n      }\n    }\n\nOr, See their documentation for more details at https://mockend.com/post-install\n\nAnd that seemed so easy but, when I tested it, it didn't work. I got some error that I needed to switch to the paid plan or select 1 repo. Nowhere did I find any information on how to \"select that 1 repo\". After a little bit if digging, this is what I found out you need to do to make things work!\n\n1. Go back to https://github.com/marketplace/mockend\n2. Click on \"Configure access\".\n\n![Mockend Setup](images/Mockend-5.jpg)\n\n3. Click the \"Configure\" button.\n\n![Mockend Setup](images/Mockend-5.jpg)\n\n4. On the next page click the radio button next to \"Only Selected Repos\" and, \n5. Select the Repo that you pushed the .mockend.json file to.\n\n![Mockend Setup](images/Mockend-6.jpg)\n\nAnd now you ARE in business!\n\n![Mockend Setup](images/Mockend-7.jpg)\n\nHave fun!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcashoefman%2Fmockend-rest-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcashoefman%2Fmockend-rest-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcashoefman%2Fmockend-rest-api-example/lists"}