Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @thiagoelg/cors-proxy with all npm packages installed. Try it out:

const express = require('express') const corsProxy = require('@isomorphic-git/cors-proxy/middleware.js') const service = require('@isomorphic-git/cors-proxy') const port = 3000 const options = { origin: '*' // insecure_origins: [''] } const app = express() app.use(corsProxy(options)) // Alternatively, app.use(service) app.get('/', (_req, res, _next) => { res.send('Hello World!') }) const rkUrl = process.env.RUNKIT_ENDPOINT_URL console.log(`You can test by running: $ npx isomorphic-git clone --corsProxy="RUNKIT_ENDPOINT_URL" --url="https://github.com/isomorphic-git/isomorphic-git.git" Redirects are not supported, so you'll need the root endpoint url... not the one that ends with a path and starts with runkit.io, but the one that ends with runkit.sh. You can find out what your endpoint url is by visiting ${rkUrl} It should look something like "https://untitled-123abc.runkit.sh" DO NOT add a forward slash at the end! `) app.listen(port, () => { console.log(`Example app listening at http://localhost:${port}`) })

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@thiagoelg/cors-proxy v0.0.2

Proxy clone and push requests for the browser

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free