createStorageRoutes
constcreateStorageRoutes: (options) =>RouteConfigEntry[] =storageRoutes
Defined in: packages/storage/src/plugin.ts:100
Backwards-friendly alias — the task description mentions
createStorageRoutes by name, so we export the same function under both
spellings to avoid surprising users.
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.