1.0.9 • Published 11 months ago

@rhildred/cors-proxy2 v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

cors-proxy2

Cloudflare worker to run with Stackblitz.com and github.com.

To use:

npm install --save-dev @rhildred/cors-proxy2

put the url in the query string. For instance:

        const res = await request(app)
        .get("/proxy?url=https://github.com/diy-pwa/diy-pwa/archive/refs/heads/main.zip");

Consume in cloudflare pages function. For instance in functions/corsproxy/[[corsproxy]].js:

import { CorsProxyResponse } from '@rhildred/cors-proxy2';

export async function onRequest(context){
    return CorsProxyResponse.fetch(context.request, context.env);
}

or as a worker I think

import { CorsProxyResponse } from '@rhildred/cors-proxy2';
export { CorsProxyResponse as default };

This code is based on the cors-proxy code from isomorphic-git. It is refactored to be exposed as a cloudflare worker or pages function.

I am consuming the cloudflare pages function in diy-pwa and git-pwa. These projects are for a stackblitz development environment for sales engineers to make progressive web apps. The pwa is for hosting .svg configuration models and complements for business to business products.

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago