{"id":28749385,"url":"https://github.com/octokit/fixtures-server","last_synced_at":"2025-06-16T20:09:11.687Z","repository":{"id":39229006,"uuid":"121049202","full_name":"octokit/fixtures-server","owner":"octokit","description":"Fixtures server for browser \u0026 language agnositic octokit testing","archived":false,"fork":false,"pushed_at":"2025-06-03T09:12:18.000Z","size":1866,"stargazers_count":29,"open_issues_count":1,"forks_count":14,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-03T17:45:02.105Z","etag":null,"topics":["hacktoberfest","octokit-js","tooling"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octokit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-10T19:58:16.000Z","updated_at":"2025-06-03T04:35:28.000Z","dependencies_parsed_at":"2023-10-03T04:55:32.047Z","dependency_job_id":"f6b144bb-05b3-48f2-9ef6-ac9098eee5cb","html_url":"https://github.com/octokit/fixtures-server","commit_stats":{"total_commits":338,"total_committers":14,"mean_commits":"24.142857142857142","dds":0.6153846153846154,"last_synced_commit":"6d838c1117de80cbe3b8c991a84ed18042175bcf"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"purl":"pkg:github/octokit/fixtures-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Ffixtures-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Ffixtures-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Ffixtures-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Ffixtures-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octokit","download_url":"https://codeload.github.com/octokit/fixtures-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octokit%2Ffixtures-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260230737,"owners_count":22978178,"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":["hacktoberfest","octokit-js","tooling"],"created_at":"2025-06-16T20:09:08.349Z","updated_at":"2025-06-16T20:09:11.679Z","avatar_url":"https://github.com/octokit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fixtures-server\n\n\u003e Fixtures server for browser \u0026 language agnostic octokit testing\n\n[![Test](https://github.com/octokit/fixtures-server/workflows/Test/badge.svg?branch=main)](https://github.com/octokit/fixtures-server/actions?query=workflow%3ATest+branch%3Amain)\n\nThe Octokit Fixtures Server is proxies requests to the mocked routes\nprovided by [@octokit/fixtures](https://github.com/octokit/fixtures).\n\n- [Usage](#usage)\n- [How it works](HOW_IT_WORKS.md)\n- [Contributing](CONTRIBUTING.md)\n- [License](#license)\n\n## Usage\n\n1. Load a fixture. All folder names at [@octokit/fixtures/scenarios/api.github.com](https://github.com/octokit/fixtures/tree/main/scenarios/api.github.com/)\n   are valid values for `scenario`.\n\n   ```\n   curl -XPOST -H'Content-Type: application/json' http://localhost:3000/fixtures -d '{\"scenario\": \"get-repository\"}'\n   ```\n\n   The response looks something like this\n\n   ```json\n   {\n     \"id\": \"fixturesid123\",\n     \"url\": \"http://localhost:3000/api.github.com/fixturesid123/api.github.com/fixturesid123\"\n   }\n   ```\n\n2. Send a request to the returned `url` as if it was https://api.github.com.\n\n   ```\n   curl -H'Authorization: token 0000000000000000000000000000000000000001' -H'Accept: application/vnd.github.v3+json' http://localhost:3000/api.github.com/fixturesid123/repos/octokit-fixture-org/hello-world\n   ```\n\nAfter that request the fixture is \"consumed\". That allows for different responses for the same requests based on order.\n\nIf you want to load custom fixtures, you'll have to use `@octokit/fixtures-server` as [standalone server](#standaloneserver)\nor as as [express middleware](#expressmiddleware).\n\n### Standalone Server\n\nDownload binary for your os from the [latest release](https://github.com/octokit/fixtures-server/releases/latest).\n\nAlternatively, you can also install `@octokit/fixtures-server` as a global npm package, if you prefer that:\n\n```\nnpm install --global @octokit/fixtures-server\n```\n\nBy default the server runs at http://localhost:3000\n\n```\noctokit-fixtures-server\n```\n\n\u003ca name=\"standalone-server-options\"\u003e\u003c/a\u003e\n\n#### Options\n\n\u003c!-- Edit at http://www.tablesgenerator.com/markdown_tables --\u003e\n\n| CLI option     | ENV variable | default                                                                 | description                                                                                                                              |\n| -------------- | ------------ | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |\n| --port         | PORT         | `3000`                                                                  | Server port number                                                                                                                       |\n| --fixtures-url | FIXTURES_URL | `'http://localhost:\u003cport\u003e'`                                             | URL to handle fixture requests (This helps with continuous deployments)                                                                  |\n| --log-level    | LOG_LEVEL    | `'info'`                                                                | One of `'debug'`, `'info'`, `'warn'`, `'error'`, `'silent'`                                                                              |\n| --ttl          | TTL          | `60000`                                                                 | Expiration time for loaded fixtures in ms                                                                                                |\n| --fixtures     | FIXTURES     | `'node_modules/@octokit/fixtures/scenarios/**/normalized-fixture.json'` | glob path to load JSON fixture files recorded with nock. Make sure to wrap the value with quotes, e.g. `--fixtures='./scenarios/*.json'` |\n\n### Express Middleware\n\n```js\nconst express = require(\"express\");\nconst app = express();\n\nconst fixturesServer = require(\"@octokit/fixtures-server\");\napp.use(\n  fixturesServer({\n    fixtures: {\n      \"my-scenario\": require(\"./scenarios/my-scenario.json\"),\n    },\n  }),\n);\n\napp.listen(3000);\n```\n\n#### Options\n\n| Option        | Default                                                                                                                            | Description                                                                    |\n| ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |\n| `fixturesUrl` | `'http://localhost:\u003cport\u003e'`                                                                                                        | URL to handle fixture requests (This helps with continuous deployments)        |\n| `logLevel`    | `'info'`                                                                                                                           | One of `'debug'`, `'info'`, `'warn'`, `'error'`, `'silent'`                    |\n| `ttl`         | `60000`                                                                                                                            | Expiration time (time to live) for loaded fixtures in ms                       |\n| `fixtures`    | fixtures from [@octokit/fixtures/scenarios/api.github.com](https://github.com/octokit/fixtures/tree/main/scenarios/api.github.com) | Object with keys being the scenario names and values being the fixtures arrays |\n\n## License\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctokit%2Ffixtures-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctokit%2Ffixtures-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctokit%2Ffixtures-server/lists"}