mirror of
https://github.com/JonasunderscoreJones/api.jonasjones.dev.git
synced 2025-10-23 20:19:19 +02:00
Initial commit (by create-cloudflare CLI)
This commit is contained in:
commit
58a42872a0
1745 changed files with 741893 additions and 0 deletions
31
node_modules/wrangler/templates/pages-dev-pipeline.ts
generated
vendored
Normal file
31
node_modules/wrangler/templates/pages-dev-pipeline.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// @ts-ignore entry point will get replaced
|
||||
import worker from "__ENTRY_POINT__";
|
||||
// @ts-ignore entry point will get replaced
|
||||
export * from "__ENTRY_POINT__";
|
||||
import { isRoutingRuleMatch } from "./pages-dev-util";
|
||||
|
||||
// @ts-ignore routes are injected
|
||||
const routes = __ROUTES__;
|
||||
|
||||
export default <ExportedHandler<{ ASSETS: Fetcher }>>{
|
||||
fetch(request, env, context) {
|
||||
const { pathname } = new URL(request.url);
|
||||
|
||||
for (const exclude of routes.exclude) {
|
||||
if (isRoutingRuleMatch(pathname, exclude)) {
|
||||
return env.ASSETS.fetch(request);
|
||||
}
|
||||
}
|
||||
|
||||
for (const include of routes.include) {
|
||||
if (isRoutingRuleMatch(pathname, include)) {
|
||||
if (worker.fetch === undefined) {
|
||||
throw new TypeError("Entry point missing `fetch` handler");
|
||||
}
|
||||
return worker.fetch(request, env, context);
|
||||
}
|
||||
}
|
||||
|
||||
return env.ASSETS.fetch(request);
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue