12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import { Middleware, Route } from '../base/http';
- import { Logger, Message } from '../base/logger';
- import { ServerProperties } from './ServerProperties';
- import { WebSocket as WS } from 'ws';
- /** @sealed */
- declare class Server {
- private instance;
- private httpServer;
- private readonly port;
- private readonly host;
- private readonly logger;
- private i18n;
- static readonly i18nDefaultPath = "../resources/i18n.json";
- static readonly defaultMiddlewaresPath = "../middlewares";
- static readonly defaultRoutesPath = "../routes";
- private readonly httpHandlers;
- private readonly wsHandlers;
- private readonly wsServers;
- private initialized;
- private readonly i18nPath?;
- private readonly middlewaresPath?;
- private readonly routesPath?;
- private readonly viewEngine?;
- private readonly viewsPath?;
- private readonly options?;
- private readonly swaggerDocsPath?;
- private readonly swaggerTitle?;
- private readonly swaggerDescription?;
- private readonly swaggerApiVersion?;
- private readonly swaggerRoute?;
- constructor(properties: ServerProperties);
- init(): Promise<Server>;
- private postInit;
- private processHttpHandlers;
- addMiddleware(middleware: Middleware): Server;
- addRoute(route: Route): Server;
- private registerRoutesDocumentation;
- registerWsServers(): Server;
- applyWsHandlers(): Server;
- getWsConnections(url: string): Set<WS> | null;
- logInfo(message: string): void;
- logError(message: string): void;
- logWarn(message: string): void;
- log(message: Message): void;
- private get;
- private post;
- private registerSwaggerMiddleware;
- registerRoutes(dir: string): Promise<Server>;
- registerMiddlewares(dir: string): Promise<Server>;
- getLogger(): Logger;
- i18nLoad(path: string): Server;
- getOption(key: string): any;
- start(callback?: () => any): void;
- }
- export { Server };
|