{"id":17033992,"url":"https://github.com/yisibell/nuxt-proxy-request","last_synced_at":"2025-10-06T22:57:33.235Z","repository":{"id":143198997,"uuid":"614700888","full_name":"yisibell/nuxt-proxy-request","owner":"yisibell","description":"A http proxy module for nuxt(3) powered by h3-proxy.","archived":false,"fork":false,"pushed_at":"2024-12-31T01:05:31.000Z","size":1401,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T20:18:13.314Z","etag":null,"topics":["h3","h3-proxy","http","http-proxy","middleware","nitro","nuxt","nuxt-module","nuxt3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/yisibell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-03-16T06:13:00.000Z","updated_at":"2024-12-31T01:05:35.000Z","dependencies_parsed_at":"2024-06-21T14:10:50.906Z","dependency_job_id":"2290d7a9-92d9-4cc1-bb80-2c2dd224c5bc","html_url":"https://github.com/yisibell/nuxt-proxy-request","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisibell%2Fnuxt-proxy-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisibell%2Fnuxt-proxy-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisibell%2Fnuxt-proxy-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yisibell%2Fnuxt-proxy-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yisibell","download_url":"https://codeload.github.com/yisibell/nuxt-proxy-request/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571640,"owners_count":21126520,"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":["h3","h3-proxy","http","http-proxy","middleware","nitro","nuxt","nuxt-module","nuxt3"],"created_at":"2024-10-14T08:37:01.305Z","updated_at":"2025-10-06T22:57:28.190Z","avatar_url":"https://github.com/yisibell.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.org/package/nuxt-proxy-request\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/nuxt-proxy-request.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmcharts.com/compare/nuxt-proxy-request?minimal=true\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/nuxt-proxy-request.svg\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n# nuxt-proxy-request\n\nA http proxy module for nuxt(3) powered by \u003ca href=\"https://github.com/yisibell/h3-proxy\"\u003e h3-proxy \u003c/a\u003e.\n\n- [✨ \u0026nbsp;Release Notes](/CHANGELOG.md)\n\n## Why use this module?\n\n- See this issue [Error when starting a Project using \"http-proxy-middleware\" with \"npm run start\" #15608](https://github.com/nuxt/nuxt/issues/15608).\n\n## Features\n\n- Support for both **development** and **production** environments.\n- Almost the same API as  [nuxt-proxy](https://github.com/wobsoriano/nuxt-proxy) that using [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware), But this module using \u003ca href=\"https://github.com/yisibell/h3-proxy\"\u003e h3-proxy \u003c/a\u003e.\n- Support **Typescript**.\n\n## Quick Setup\n\n1. Add `nuxt-proxy-request` dependency to your project\n\n```bash\n# Using pnpm\npnpm add -D nuxt-proxy-request\n\n# Using yarn\nyarn add --dev nuxt-proxy-request\n\n# Using npm\nnpm install --save-dev nuxt-proxy-request\n```\n\n2. Add `nuxt-proxy-request` to the `modules` section of `nuxt.config.ts`\n\n```js\nexport default defineNuxtConfig({\n  modules: [\n    'nuxt-proxy-request'\n  ],\n  proxy: {\n    options: [\n      {\n        target: 'http://www.example.com',\n        pathFilter: ['/api/**'],\n        pathRewrite: {\n          '^/api': ''\n        }\n      }\n    ]\n  }\n  // OR\n  // runtimeConfig: {\n  //   proxy: {...}\n  // }\n})\n```\n\nThat's it! You can now use **nuxt-proxy-request** in your Nuxt app ✨\n\n## Options\n\n| Key | Type | Default value | Description |\n| :---: | :---: | :---: | :---: |\n| `options` | `object/Array\u003cobject\u003e` | `[]` | Configure which targets you want to proxy. :warning: TIPS: More **config object** please see [h3-proxy's Options](https://github.com/yisibell/h3-proxy#options), You can pass an **array of options** for multiple targets or pass an **object of options** for single target.|\n\n\n### :warning: Do not when the value of a certain configuration item is a function type :warning:\n\n1. Do not use `runtimeConfig.proxy` for configuration, as the function type value in the `runtimeConfig` object will be ignored. Please use `proxy` for configuration as it has undergone special processing on the internal implementation.\n\n2. Do not use any external variables within the function body.\n\n```ts\nimport foo from 'foo'\n\nexport default defineNuxtConfig({\n  modules: [\n    'nuxt-proxy-request'\n  ],\n  proxy: {\n    options: [\n      {\n        target: 'http://www.example.com',\n        pathFilter: function(path, req) {\n          console.log(foo) /* At runtime, foo is undefined. */\n\n          return path.match(/^\\/api/) \u0026\u0026 req.method === 'GET';\n        },\n        pathRewrite: {\n          '^/api': ''\n        }\n      }\n    ]\n  }\n})\n```\n\n3. Do not use **RegExp** literal, using `new RegExp()` instead, in function body.\n\n4. Do not use **Single-Line Comments**, using **Multiple-Line Comments** instead, in function body.\n\n\u003e If the above points cause you trouble. You can use `h3-proxy` directly. See [how to use h3-proxy in Nuxt3 Project](https://github.com/yisibell/h3-proxy#nuxt).\n\n## Development\n\n```bash\n# Install dependencies\npnpm install\n\n# Generate type stubs\npnpm run dev:prepare\n\n# Develop with the playground\npnpm run dev\n\n# Build the playground\npnpm run dev:build\n\n# Run ESLint\npnpm run lint\n\n# Run Vitest\npnpm run test\npnpm run test:watch\n\n# Release new version\npnpm run release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyisibell%2Fnuxt-proxy-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyisibell%2Fnuxt-proxy-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyisibell%2Fnuxt-proxy-request/lists"}