change: everything

This commit is contained in:
Xory 2026-02-07 16:12:58 +02:00
parent 1e09c02cb9
commit a49c5d8bcc
15 changed files with 1107 additions and 229 deletions

View file

@ -0,0 +1,16 @@
import { type LoaderFunctionArgs } from "react-router";
export async function loader({ params, context }: LoaderFunctionArgs) {
const { postId } = params;
// 'context.cloudflare.env' contains your bindings
const { API } = context.cloudflare.env;
// Use the Service Binding to talk to the backend
// This is much faster than a standard fetch over the internet
const response = await API.fetch(
`http://internal/posts/${postId}/view`
);
return response;
}