{"id":22343042,"url":"https://github.com/wiiseguy/axios-controller","last_synced_at":"2026-01-31T20:33:50.389Z","repository":{"id":57188584,"uuid":"349359255","full_name":"Wiiseguy/axios-controller","owner":"Wiiseguy","description":"Easily create a proxy that matches your Web API Controller. Supports axios.","archived":false,"fork":false,"pushed_at":"2024-07-12T11:12:56.000Z","size":120,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-07T04:05:46.646Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wiiseguy.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}},"created_at":"2021-03-19T08:57:37.000Z","updated_at":"2024-07-12T11:13:00.000Z","dependencies_parsed_at":"2024-07-12T13:13:25.524Z","dependency_job_id":null,"html_url":"https://github.com/Wiiseguy/axios-controller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Wiiseguy/axios-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wiiseguy%2Faxios-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wiiseguy%2Faxios-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wiiseguy%2Faxios-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wiiseguy%2Faxios-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wiiseguy","download_url":"https://codeload.github.com/Wiiseguy/axios-controller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wiiseguy%2Faxios-controller/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261396533,"owners_count":23152451,"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-12-04T08:14:37.522Z","updated_at":"2026-01-31T20:33:50.349Z","avatar_url":"https://github.com/Wiiseguy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# axios-controller\nEasily create a controller proxy that matches your Web API Controller using axios.\n\n### Installation\n```\nnpm i axios-controller\n```\n\n### Usage\n\nCommonJS\n```js\nconst axios = require('axios');\nconst axiosController = require('axios-controller');\n```\n\nES Module\n\n```js\nimport axios from 'axios';\nimport axiosController from 'axios-controller';\n```\n\n```js\nconst axiosInstance = axios.create({\n  baseURL: 'https://api.example.com/'\n});\n\nconst Controller = axiosController.build(axiosInstance);\n\nconst bookController = Controller('book', http =\u003e {\n  return {\n    all: _ =\u003e http.get(),\n    get: id =\u003e http.get(id),\n    create: book =\u003e http.post(book),\n    update: book =\u003e http.put(book),\n    delete: id =\u003e http.delete(id),\n  }\n});\n\n// You can use Controller to create multiple controller proxies\nconst authorController = Controller('author', http =\u003e {\n  return {\n    get: id =\u003e http.get(id),\n    getBooksByAuthor: id =\u003e http.get(`books/${id}`)\n  }\n});\n\nawait bookController.get(1); // { id: 1, author: 8, title: 'ABC' }\n\nawait authorController.getBooksByAuthor(8); // [{ id: 1, author: 8, title: 'ABC' }, ...]\n```\n\n#### No response unwrapping\n\nNote that axios-controller will 'unwrap' the response object. This means that by default the `data` property of the Axios response will be returned.\nYou can disable this behavior by setting the `unwrap` option to false:\n\n```js\nconst Controller = buildController(axiosInstance, { unwrap: false });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiiseguy%2Faxios-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiiseguy%2Faxios-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiiseguy%2Faxios-controller/lists"}