This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Start Script for api server to use bun (#61)
* change start script but broke api server (now having json errors) * upgrade winterspec, fixing the compat serving issue * update bun lockfiles
- Loading branch information
Showing
8 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
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
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 |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { createFetchHandlerFromDir } from "winterspec/adapters/node" | ||
import { Request as EdgeRuntimeRequest } from "@edge-runtime/primitives" | ||
|
||
const serverFetch = await createFetchHandlerFromDir("./routes") | ||
|
||
console.log("starting dev-server-api on localhost:3021") | ||
Bun.serve({ | ||
fetch: (req) => serverFetch(req), | ||
fetch: (bunReq) => { | ||
const req = new EdgeRuntimeRequest(bunReq.url, { | ||
headers: bunReq.headers, | ||
method: bunReq.method, | ||
body: bunReq.body, | ||
}) | ||
return serverFetch(req as any) | ||
}, | ||
port: 3021, | ||
}) |
Binary file not shown.
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
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
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