Skip to content

Commit 60bfc45

Browse files
committed
Remove pre-inserted template code
1 parent 0be5dd0 commit 60bfc45

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

src/index.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ interface Env {
1717
DATABASE_DURABLE_OBJECT: DurableObjectNamespace;
1818
STUDIO_USER?: string;
1919
STUDIO_PASS?: string;
20-
// ## DO NOT REMOVE: INSERT TEMPLATE INTERFACE ##
21-
AUTH: {
22-
handleAuth(pathname: string, verb: string, body: any): Promise<Response>;
23-
}
20+
// ## DO NOT REMOVE: TEMPLATE INTERFACE ##
2421
}
2522

2623
export class DatabaseDurableObject extends DurableObject {
@@ -293,16 +290,7 @@ export default {
293290
let id: DurableObjectId = env.DATABASE_DURABLE_OBJECT.idFromName(DURABLE_OBJECT_ID);
294291
let stub = env.DATABASE_DURABLE_OBJECT.get(id);
295292

296-
// ## DO NOT REMOVE: INSERT TEMPLATE ROUTING LOGIC ##
297-
298-
/**
299-
* If the pathname starts with /auth, we want to pass the request off to another Worker
300-
* that is responsible for handling authentication.
301-
*/
302-
if (pathname.startsWith('/auth')) {
303-
const body = await request.json();
304-
return await env.AUTH.handleAuth(pathname, request.method, body);
305-
}
293+
// ## DO NOT REMOVE: TEMPLATE ROUTING ##
306294

307295
/**
308296
* Pass the fetch request directly to the Durable Object, which will handle the request

wrangler.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ compatibility_date = "2024-09-25"
55
account_id = ""
66

77
# Service Bindings
8-
## DO NOT REMOVE: INSERT TEMPLATE SERVICE BINDINGS ##
9-
[[services]]
10-
binding = "AUTH"
11-
service = "starbasedb_auth"
12-
entrypoint = "AuthEntrypoint"
8+
## DO NOT REMOVE: TEMPLATE SERVICES ##
139

1410
# Workers Logs
1511
# Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
@@ -35,5 +31,5 @@ AUTHORIZATION_TOKEN = "ABC123"
3531

3632
# Uncomment the section below to create a user for logging into your database UI.
3733
# You can access the Studio UI at: https://your_endpoint/studio
38-
STUDIO_USER = "admin"
39-
STUDIO_PASS = "123456"
34+
# STUDIO_USER = "admin"
35+
# STUDIO_PASS = "123456"

0 commit comments

Comments
 (0)