Skip to content

Commit 36764ce

Browse files
authored
refactor: Use alias instead of snapshot (#20)
Also, no need to export handleRequest
1 parent b9bb9f3 commit 36764ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

reps/src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Server as BaseServer } from "./server/server";
22
import { mutators, type M } from "../../datamodel/mutators";
33

4-
export async function handleRequest(request: Request, env: Bindings) {
4+
async function fetch(request: Request, env: Bindings) {
55
// Match route against pattern /:name/*action
66
const url = new URL(request.url);
77

@@ -25,12 +25,12 @@ export async function handleRequest(request: Request, env: Bindings) {
2525
return stub.fetch(request);
2626
}
2727

28-
const worker: ExportedHandler<Bindings> = { fetch: handleRequest };
28+
const worker: ExportedHandler<Bindings> = { fetch };
2929

3030
export class Server extends BaseServer<M> {
3131
constructor(state: DurableObjectState) {
3232
super(mutators, state);
3333
}
3434
}
3535

36-
export default worker;
36+
export {worker as default};

0 commit comments

Comments
 (0)