-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27e7699
commit 8e8fca8
Showing
6 changed files
with
206 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "telemetry", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"deploy": "wrangler deploy", | ||
"dev": "wrangler dev", | ||
"start": "wrangler dev", | ||
"cf-typegen": "wrangler types" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^4.20231218.0", | ||
"typescript": "^5.5.2", | ||
"wrangler": "^3.60.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
async fetch(request): Promise<Response> { | ||
// https://github.com/mixpanel/tracking-proxy/blob/master/nginx.conf | ||
const headers = new Headers(request.headers); | ||
if (request.method !== 'POST' && request.method !== 'OPTIONS') { | ||
console.log(request.headers.get('Origin')); | ||
return new Response('Method Not Allowed', { status: 405 }); | ||
} | ||
headers.set('Host', 'api-eu.mixpanel.com'); | ||
const res = await fetch(request, { | ||
headers, | ||
}); | ||
return res; | ||
}, | ||
} satisfies ExportedHandler<Env>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./src/" | ||
}, | ||
"include": ["./src", "worker-configuration.d.ts"], | ||
"references": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Generated by Wrangler | ||
// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen` | ||
interface Env { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name = "telemetry" | ||
main = "./src/index.ts" | ||
compatibility_date = "2024-07-24" |
Oops, something went wrong.