storageRoutes
storageRoutes(
options):RouteConfigEntry[]
Defined in: packages/storage/src/plugin.ts:83
Build the React Router route-config entries that mount the /uploads/*
proxy + upload endpoint. The returned array is meant to be spread into
the user’s routes.ts default export.
The single splat route dispatches on HTTP method inside the handler file:
GET /uploads/<key>— streams the R2 object atkey, optionally gated by a signed token or anownerCheckfunction.POST /uploads/<filetype>— uploads a multipart file for the named filetype, returning{ key, url }.
Parameters
Section titled “Parameters”options
Section titled “options”Handler file location and (optional) base path.
Returns
Section titled “Returns”RouteConfigEntry[]
One or more RouteConfigEntry objects.