Skip to content

Commit

Permalink
fix: itty request type (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
thantos authored Dec 15, 2022
1 parent 7632135 commit d66222a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 7 additions & 2 deletions packages/@eventual/core/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import itty from "itty-router";
export const api: Router = itty.Router() as any as Router;

export type RouteHandler = (
request: Request,
request: ApiRequest,
...args: any
) => Response | Promise<Response>;

export interface ApiRequest extends Request {
query?: Record<string, string>;
params?: Record<string, string>;
}

export type Route = (path: string, ...handlers: RouteHandler[]) => Router;

export interface Router {
handle: (request: Request, ...extra: any) => Promise<Response>;
handle: (request: ApiRequest, ...extra: any) => Promise<Response>;
routes: RouteEntry[];
all: Route;
get: Route;
Expand Down
4 changes: 0 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
"dependsOn": ["^build"],
"outputs": ["lib/**"]
},
"@gluestik/frontend#build": {
"dependsOn": ["^build", "build:src"],
"outputs": [".next/**"]
},
"build:src": {
"outputs": ["lib/**"]
},
Expand Down

0 comments on commit d66222a

Please sign in to comment.