Skip to content

Commit

Permalink
more content updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanushree Sharma committed Sep 25, 2024
1 parent b4e4e06 commit 940164e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/content/docs/workers/static-assets/binding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import {
Tabs,
} from "~/components";

Configuring a project with assets requires specifying a [directory](/workers/configuration/assets/#directory) or an [assets binding](/workers/static-assets/binding/) in the project's `wrangler.toml` file. Only one assets directory/binding can be configured for each project.
Configuring a project with assets requires specifying a [directory](/workers/configuration/assets/#directory) or an [assets binding](/workers/static-assets/binding/) in the project's `wrangler.toml` file. The [assets binding](/workers/static-assets/binding/) allows you to dynamically invoke assets from the Worker using `env.ASSETS.fetch()`.

Only one assets directory/binding can be configured for each project.

## Directory

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
pcx_content_type: concept
title: Compatibility Matrix
title: Workers vs Pages (compatibility matrix)
sidebar:
order: 10
head: []
Expand Down
6 changes: 4 additions & 2 deletions src/content/docs/workers/static-assets/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ import {
PackageManagers,
} from "~/components";

This guide will instruct you through setting up and deploying a static site or a full-stack application without a framework on Workers. You may prefer to build your website from scratch if:
For most frontend applications, you'll want to use a framework. Workers supports number of popular [frameworks](/workers/frameworks/) that come with ready-to-use components, a pre-defined structured architecture, and community support. View [framework specific guides](/workers/frameworks/) to get started using a framework.

Alternativley, you may prefer to build your website from scratch if:

- You're interested in learning by implementing core functionalities on your own.
- You're working on a simple project where you might not need a framework.
- You want to optimize for performance by minimizing external dependencies.
- You require complete control over every aspect of the application.
- You want to build your own framework.

Alternativley, you use can a number of popular [frameworks](/workers/frameworks/) that come with ready-to-use components, a pre-defined structured architecture, and community support. View [framework specific guides](/workers/frameworks/) to get started using a framework.
This guide will instruct you through setting up and deploying a static site or a full-stack application without a framework on Workers.

## Deploy a static site

Expand Down
6 changes: 4 additions & 2 deletions src/content/docs/workers/static-assets/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Deploy static sites like blogs, portfolios, or documentation pages. Serve HTML,

Build dynamic and interactive server-side rendered (SSR) applications on Cloudflare Workers.

Combine asset hosting with Cloudflare's data and storage products such as [Workers KV](/kv/), [Durable Objects](/durable-objects/), and [R2 Storage](/r2/) to build full-stack applications. Manage both frontend and backend logic on Cloudflare's Developer Platform.
You can combine asset hosting with Cloudflare's data and storage products such as [Workers KV](/kv/), [Durable Objects](/durable-objects/), and [R2 Storage](/r2/) to build full-stack applications that serve both frontend and backend logic in a single Worker.

<LinkButton href="/workers/static-assets/get-started/#deploy-a-full-stack-application">
Deploy a full-stack application
Expand All @@ -61,7 +61,9 @@ Static Assets for Workers is currently in open beta. If you're looking for a fra

### Pricing

Requests to static assets are free and unlimited. Refer to [pricing](/workers/platform/pricing/#example-2) for an example.
Requests to a project with static assets can either return static assets or invoke the Worker, dependent on [file-based routing](/workers/static-assets/routing/#file-based-routing).

**Requests to static assets are free and unlimited**. Requests to the Worker (eg. in the case of SSR content) are billed according to Workers pricing. Refer to [pricing](/workers/platform/pricing/#example-2) for an example.

### Limitations

Expand Down
8 changes: 7 additions & 1 deletion src/content/docs/workers/static-assets/routing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ Based on the incoming requests, the following assets would be served:

### Alternate configuration options

Alternate configuration options are outlined on this page and can be specified in your project's `wrangler.toml` file. If you're deploying using a Framework[link], these options will be defined by the Framework provider.
Alternate configuration options are outlined on this page and can be specified in your project's [`wrangler.toml`](/workers/wrangler/configuration/#assets) file. If you're deploying using a [framework](/workers/frameworks/), these options will be defined by the framework provider.

Example `wrangler.toml` configuration:

```toml title="wrangler.toml"
assets = { directory = "./public", binding = "ASSETS", html_handling = "force-trailing-slash", not_found_handling = "none" }
```

#### `html_handling = "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none"`

Expand Down

0 comments on commit 940164e

Please sign in to comment.