{"id":41128719,"url":"https://github.com/yowcow/stubby","last_synced_at":"2026-01-22T18:17:17.324Z","repository":{"id":56235618,"uuid":"247896960","full_name":"yowcow/stubby","owner":"yowcow","description":"A stub server and request recorder for testing","archived":false,"fork":false,"pushed_at":"2025-09-04T05:59:24.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-04T07:12:10.550Z","etag":null,"topics":["cowboy","erlang","testing"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yowcow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-03-17T06:35:05.000Z","updated_at":"2025-09-04T05:58:47.000Z","dependencies_parsed_at":"2025-09-04T07:06:26.708Z","dependency_job_id":"396e3feb-34df-4e49-813f-620b3bf6efbe","html_url":"https://github.com/yowcow/stubby","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/yowcow/stubby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowcow%2Fstubby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowcow%2Fstubby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowcow%2Fstubby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowcow%2Fstubby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yowcow","download_url":"https://codeload.github.com/yowcow/stubby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowcow%2Fstubby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28667907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cowboy","erlang","testing"],"created_at":"2026-01-22T18:17:16.749Z","updated_at":"2026-01-22T18:17:17.312Z","avatar_url":"https://github.com/yowcow.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stubby\n\nA stub http server and request body recorder.\n\n## Build\n\n    rebar3 compile\n\n## How to use\n\n### Configuration\n\nIn rebar.config deps, have:\n\n    {stubby, {git, \"git://github.com/yowcow/stubby\", {branch, \"master}}}\n\n### Testing\n\nIn testing, e.g., common tests, have:\n\n```erlang\ninit_per_suite(Config) -\u003e\n    Url = stubby:start(),\n    [{url, Url} | Config].\n\nend_per_suite(_) -\u003e\n    ok = stubby:stop().\n```\n\nSee src/stubby.erl for more options starting up a server.\n\nIn a testcase, make a request to stubby URL, then get the most recent request to the **specified** path with:\n\n```erlang\n{ok, #{\n  headers := Headers,\n  scheme := Scheme,\n  host := Host,\n  port := Port,\n  path := Path,\n  qs := QueryString,\n  body := Body\n }} = stubby:get_recent(\"/path/to/endopoint\")\n```\n\nWhen no request is recorded yet, this call blocks until the first request is made.\n\n## Endpoints\n\nBy default, a booted stubby serves:\n\n- `/`: always responds with status code 200\n- `/blackhole/[...]`: always responds with status code 204\n\nAdditional cowboy endpoints can be added as a start option:\n\n```erlang\nstubby:start([\n   {\"/new/endpoint1\", new_endpoint1_handler, []},\n   {\"/new/endpoint2\", new_endpoint2_handler, []}\n  ])\n```\n\n## See also\n\n- \u003chttps://github.com/ninenines/cowboy\u003e\n- \u003chttps://erlang.org/doc/apps/common_test/introduction.html\u003e\n- \u003chttps://erlang.org/doc/man/common_test.html\u003e\n- \u003chttps://www.rebar3.org/docs/running-tests#section-common-test\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyowcow%2Fstubby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyowcow%2Fstubby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyowcow%2Fstubby/lists"}