Create repo.js

This commit is contained in:
Ivan Blinkov 2020-02-20 16:33:19 +03:00 committed by GitHub
parent 87b32a2831
commit 0c686baf4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
website/workers/repo.js Normal file
View File

@ -0,0 +1,10 @@
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
let url = new URL(request.url);
url.hostname = 'repo.yandex.ru';
url.pathname = '/clickhouse' + url.pathname;
return fetch(url)
}