This commit is contained in:
Manav Rathi
2024-06-16 20:26:55 +05:30
parent b4dc49ef2f
commit ed406e7eb0
4 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
{
"name": "uploader",
"private": true,
"devDependencies": {
"@cloudflare/workers-types": "^4.20240614.0",
"typescript": "^5",
"wrangler": "^3"
},
"packageManager": "yarn@1.22.22"
}

View File

@@ -0,0 +1,19 @@
/**
* Proxy file uploads.
*
* See: https://ente.io/blog/tech/making-uploads-faster/
*/
export default {
async fetch(request: Request) {
switch (request.method) {
// case "OPTIONS":
// return handleOPTIONS(request);
// case "GET":
// return handleGET(request);
default:
console.log(`Unsupported HTTP method ${request.method}`);
return new Response(null, { status: 405 });
}
},
} satisfies ExportedHandler;

View File

@@ -0,0 +1 @@
{ "extends": "../tsconfig.base.json", "include": ["src"] }

View File

@@ -0,0 +1,7 @@
name = "uploader"
main = "src/index.ts"
compatibility_date = "2024-06-14"
routes = [{ pattern = "uploader.ente.io", custom_domain = true }]
tail_consumers = [{ service = "tail" }]