-
Notifications
You must be signed in to change notification settings - Fork 742
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
81d57c4
commit 9a4f07b
Showing
5 changed files
with
78 additions
and
8 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 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
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,31 @@ | ||
/** | ||
* This Worker is used as a default entry-point for Assets-only | ||
* Workers. It proxies the request directly on to the Asset Sever | ||
* Worker service binding. | ||
* | ||
* In an Assets-only Workers world, we want to enable users | ||
* to deploy a Worker with Assets without ever having to provide | ||
* a User Worker. | ||
* | ||
* ```bash | ||
* wrangler dev --experimental-assets dist | ||
* wrangler deploy --experimental-assets dist | ||
* ``` | ||
* | ||
* ```toml | ||
* name = "assets-only-worker" | ||
* compatibility_date = "2024-01-01" | ||
* ``` | ||
* | ||
* Without a user-defined Worker, which usually serves as the entry | ||
* point in the bundling process, wrangler needs to default to some | ||
* other entry-point Worker for all intents and purposes. This is what | ||
* this Worker is. | ||
*/ | ||
|
||
export default { | ||
async fetch(request: Request, env) { | ||
const response = await env.ASSET_SERVER.fetch(request.url, request); | ||
return new Response(response.body, response); | ||
}, | ||
}; |