-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97256f4
commit f822d32
Showing
6 changed files
with
79 additions
and
68 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Hint Cloudflare to avoid going to the Worker for HTML | ||
/o/* /index.html 200 |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { APIEvent } from "@solidjs/start/server"; | ||
import { env } from "~/env"; | ||
|
||
async function handler({ request, params }: APIEvent) { | ||
console.log(params.rest); | ||
|
||
const url = new URL(env.RUST_URL); | ||
url.pathname = params.rest!; | ||
console.log(url.toString()); | ||
const resp = await fetch(url.toString(), { | ||
method: request.method, | ||
headers: request.headers, | ||
body: request.body, | ||
}); | ||
const headers = new Headers(resp.headers); | ||
headers.delete("content-encoding"); // SS has a fit if we pass this through | ||
headers.delete("strict-transport-security"); | ||
return new Response(resp.body, { | ||
status: resp.status, | ||
statusText: resp.statusText, | ||
headers, | ||
}); | ||
} | ||
|
||
export const GET = handler; | ||
export const POST = handler; | ||
export const PUT = handler; | ||
export const PATCH = handler; | ||
export const DELETE = handler; |
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