basalt / files/src / fileRoutes
Function: fileRoutes()
> fileRoutes(options?): BasaltRoute[]
Defined in: files/src/plugin.ts:211
Read/manage routes for the current tenant's files: list, metadata, the bytes (streamed), a signed URL, and delete. POST /files — a streamed upload straight into storage — is opt-in via upload: { maxBytes, … }; without it you write the upload route yourself with the neutral upload() body kind.
With requireScan, GET /files/:id/content and POST /files/:id/url answer 423 FILE_NOT_SCANNED until the file is scanned clean and 403 FILE_INFECTED after a failed scan — before any byte of the body is sent (the errors carry their status, so every adapter maps them the same way); GET /files and GET /files/:id still list the record with its scan state.
Records are answered through present (default toPublicFile), so the storage path, checksum, uploader and scan detail stay server-side.
Secure by default: a user reaches only the files they uploaded. Pass authorize for your own policy, or shared: true for a tenant-wide drive. A file the caller may not reach answers 404, exactly like a missing one.
Parameters
options?
FileRoutesOptions = {}