Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

fnOnlyCalledByServer.ts

6 lines277 Bytes

1import { createServerFn } from '@tanstack/react-start'
2​
3// This function is ONLY called from the server, never directly from client code
4export const fnOnlyCalledByServer = createServerFn().handler(() => {
5 return { message: 'hello from server-only function', secret: 42 }
6})