Skip to content

Commit

Permalink
adds log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
walt-1 committed Nov 14, 2023
1 parent 4a4a73c commit 5650826
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ export default {

const upgradeHeader = request.headers.get('Upgrade')

console.log(`UPGRADE_HEADER: ${upgradeHeader}`);

if (upgradeHeader || upgradeHeader === 'websocket') {
return await fetch(`https://mainnet.helius-rpc.com/?api-key=${env.HELIUS_API_KEY}`, request)
}


const { pathname, search } = new URL(request.url)
console.log(`URL: ${JSON.stringify(request.url)}`);

const payload = await request.text();
const proxyRequest = new Request(`https://${pathname === '/' ? 'mainnet.helius-rpc.com' : 'api.helius.xyz'}${pathname}?api-key=${env.HELIUS_API_KEY}${search ? `&${search.slice(1)}` : ''}`, {
method: request.method,
Expand Down

0 comments on commit 5650826

Please sign in to comment.