Appearance
API Reference
Welcome to the Nora Framework API Reference. This section provides detailed documentation for all the framework's components, configurations, and features.
Available APIs
Core Components
Decorators
Comprehensive guide to all available decorators for routing, authentication, and feature enablement.
typescript
@Route("api/users")
@Authorize()
export class UserController extends Controller {
@Get()
async getUsers() {}
}
Configuration
Complete reference for configuring your Nora application.
typescript
const config: NoraConfig = {
database: {
/* ... */
},
auth: {
/* ... */
},
cors: {
/* ... */
},
};
Data Management
Database
Database operations, query building, and model management.
typescript
const users = await this.db
?.model("users", UserModel)
.where({ status: "active" })
.toList();
AI Features
LLM
Large Language Model integration and usage.
typescript
const response = await request.llmChat(prompt);
Embeddings
Vector embeddings and similarity search capabilities.
typescript
await request.embedding.createEmbed(text, dbName, tableName);
Type Reference
Request and Response Types
typescript
interface RequestType extends FastifyRequest {
user?: JwtPayload;
llmChat?: LlmFunction;
embedding?: EmbeddingFunctions;
}
interface ReplyType extends FastifyReply {
stream: (data: any) => void;
}
Configuration Types
typescript
interface NoraConfig {
serverOptions?: FastifyServerOptions;
auth?: AuthConfig;
database?: DatabaseConfig;
cors?: FastifyCorsOptions;
llm?: LlmConfig;
embedding?: EmbeddingConfig;
}