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

middleware.ts

10 lines339 Bytes

1/**
2 * Middleware that logs server function calls.
3 * This is exported through a barrel file that also re-exports type-only modules.
4 */
5import { createMiddleware } from '@tanstack/react-start'
6​
7export const loggingMiddleware = createMiddleware().server(({ next }) => {
8 console.log('[logging] Server function called')
9 return next()
10})