Skip to main content
Home
Works with
This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score94%
Downloads2/wk
Published2 months ago (0.1.2)

Vite dev proxy for /api/* to a localhost backend. Streams requests/responses, preserves headers/status/cookies, merges Set-Cookie, and aborts on client disconnect—avoids CORS.

Vite API Proxy

A tiny Vite dev plugin that proxies API requests (e.g. /api/*) to a local backend, streaming requests/responses and preserving headers, status, and cookies. Useful to avoid CORS during local development.

(We had issues with the built-in proxy from vite)

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@01edu/api-proxy

Import symbol

import * as api_proxy from "@01edu/api-proxy";
or

Import directly with a jsr specifier

import * as api_proxy from "jsr:@01edu/api-proxy";

Add Package

pnpm i jsr:@01edu/api-proxy
or (using pnpm 10.8 or older)
pnpm dlx jsr add @01edu/api-proxy

Import symbol

import * as api_proxy from "@01edu/api-proxy";

Add Package

yarn add jsr:@01edu/api-proxy
or (using Yarn 4.8 or older)
yarn dlx jsr add @01edu/api-proxy

Import symbol

import * as api_proxy from "@01edu/api-proxy";

Add Package

vlt install jsr:@01edu/api-proxy

Import symbol

import * as api_proxy from "@01edu/api-proxy";

Add Package

npx jsr add @01edu/api-proxy

Import symbol

import * as api_proxy from "@01edu/api-proxy";

Add Package

bunx jsr add @01edu/api-proxy

Import symbol

import * as api_proxy from "@01edu/api-proxy";