1.0.9 • Published 2 years ago

@rhildred/cors-proxy2 v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago