UNPKG

@flavoai/fastfold

Version:

Zero-boilerplate backend for React apps with auto-generated CRUD and declarative security

75 lines 1.71 kB
import { Express } from 'express'; import { TableDefinition, DatabaseProvider } from '../types'; interface LegacyServerConfig { database: { provider: DatabaseProvider; connection: any; }; tables: { [tableName: string]: TableDefinition; }; auth?: { secret?: string; expiresIn?: string; }; port?: number; } export declare class FastfoldServer { private app; private config; private db; private crudGenerator; private docGenerator; private apiExplorer; constructor(config: LegacyServerConfig); /** * Initialize the server - connect to database and create tables */ initialize(): Promise<void>; /** * Start the server */ start(port?: number): Promise<void>; /** * Get the Express app instance */ getApp(): Express; /** * Setup middleware */ private setupMiddleware; /** * Authentication middleware */ private authMiddleware; /** * Setup API routes for all tables */ private setupRoutes; /** * Setup CRUD routes for a specific table */ private setupTableRoutes; /** * Create request context for security checks */ private createRequestContext; /** * Parse ID parameter (handles both string and number IDs) */ private parseId; /** * Handle errors consistently */ private handleError; /** * Graceful shutdown */ shutdown(): Promise<void>; } /** * Quick start function for Fastfold */ export declare function createFastfoldServer(config: LegacyServerConfig): FastfoldServer; export {}; //# sourceMappingURL=index.d.ts.map