fix: change MultiHandler back to Handlers (#1396)

This commit is contained in:
Marvin Hagemeister
2023-07-03 09:57:46 +02:00
committed by GitHub
parent eb53d53ab8
commit 16be99e69b
32 changed files with 135 additions and 66 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
---
description: |
Fetch data for routes dynamically by creating a custom handler and passing
data to the render function.
data to the render function.
---
All of the pages in the demo project so far have not used any dynamic data
@@ -23,7 +23,7 @@ renders it in a page component.
```tsx
// routes/github/[username].tsx
import { MultiHandler, PageProps } from "$fresh/server.ts";
import { Handlers, PageProps } from "$fresh/server.ts";
interface User {
login: string;
@@ -31,7 +31,7 @@ interface User {
avatar_url: string;
}
export const handler: MultiHandler<User | null> = {
export const handler: Handlers<User | null> = {
async GET(_, ctx) {
const { username } = ctx.params;
const resp = await fetch(`https://api.github.com/users/${username}`);