docs: fix misleading main.tsx filenames (#3477)
Closes #3476 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Bartek Iwańczuk
Claude Opus 4.6
parent
be467d3cdb
commit
420a8cfb8e
@@ -40,7 +40,7 @@ mounted alongside other apps. The base path is available in handlers via
|
||||
All items are applied from top to bottom. This means that when you defined a
|
||||
middleware _after_ a `.get()` handler, it won't be included.
|
||||
|
||||
```ts main.ts
|
||||
```ts
|
||||
const app = new App()
|
||||
.use((ctx) => {
|
||||
// Will be called for all middlewares
|
||||
|
||||
@@ -7,6 +7,8 @@ Routing defines which middlewares and routes should respond to a particular
|
||||
request.
|
||||
|
||||
```ts main.ts
|
||||
import { App } from "fresh";
|
||||
|
||||
const app = new App()
|
||||
.get("/", () => new Response("hello")) // Responds to: GET /
|
||||
.get("/other", () => new Response("other")) // Responds to: GET /other
|
||||
|
||||
@@ -52,7 +52,7 @@ once in your build output.
|
||||
By default, Fresh adds caching headers for the `src` and `srcset` attributes on
|
||||
`<img>` and `<source>` tags.
|
||||
|
||||
```tsx main.tsx
|
||||
```ts
|
||||
// Caching headers will be automatically added
|
||||
app.get("/user", (ctx) => ctx.render(<img src="/user.png" />));
|
||||
```
|
||||
@@ -60,7 +60,7 @@ app.get("/user", (ctx) => ctx.render(<img src="/user.png" />));
|
||||
You can always opt out of this behaviour per tag, by adding the
|
||||
`data-fresh-disable-lock` attribute.
|
||||
|
||||
```tsx main.tsx
|
||||
```ts
|
||||
// Opt-out of automatic caching headers
|
||||
app.get(
|
||||
"/user",
|
||||
|
||||
Reference in New Issue
Block a user