GET
Declares that a server-function read can use HTTP GET. Calls use a cacheable URL when the encoded arguments fit and fall back to a read-only POST when they do not.
See Reads, streams, and live data for caching, URL limits, and HEAD behavior.
Import
import { GET } from "@solidjs/web/server-functions";Type signature
function GET<A extends readonly any[], R>( fn: (...args: A) => R): ServerFunction<A, Awaited<R>>;Parameters
fn
- Type:
(...args: A) => R
Examples
export const getUser = GET(async (id: string) => { "use server"; return database.users.find(id);});