Type Definition
&):
- Base Context object (request, reply, etc.)
AuthContext: Authentication-related properties (user, session)ContextExtend: Project-specific extension properties
Context Properties
request
reply
headers
request.headers, provided for convenience.
createSSE
naiteStore
locale
Accept-Language header and automatically selects one of the supported locales. If no match is found, the defaultLocale is used.
Configuration Example:
bufferedFiles
@upload decorator is applied with the default mode (buffer) or mode: "buffer" configuration.
Each file is loaded in memory, allowing flexible operations like MD5 calculation or image processing.
BufferedFile Key Properties and Methods:
uploadedFiles
@upload({ consume: "stream", destination: "..." }) is configured.
Files have already been streamed to storage, so only metadata like URL/key is accessible. This mode is suitable for large file uploads.
UploadedFile Key Properties and Methods:
File Upload Handling: - Must be used with the
@upload decorator - Buffer mode (default): Use
bufferedFiles - loaded in memory, suitable for MD5 calculation/image processing - Stream mode:
Use uploadedFiles - streamed directly to storage, suitable for large files - See @upload
decorator documentation for more detailsAuthContext Properties
Context also includes properties from AuthContext:user: Current authenticated user information (User | null)session: Current session information (Session | null)
Extending Context
To add custom properties to Context in your project, you can extend theContextExtend interface:
contextProvider: