UNPKG

@dooboostore/simple-boot-http-server

Version:
83 lines 3.54 kB
import { InitOptionType, SimOption } from '@dooboostore/simple-boot/SimOption'; import { ConstructorType } from '@dooboostore/core/types'; import { Server as HttpServer, ServerOptions } from 'http'; import { Server as HttpsServer, ServerOptions as HttpsServerOption } from 'https'; import { Filter } from '../filters/Filter'; import { EndPoint } from '../endpoints/EndPoint'; import { RequestResponse } from '../models/RequestResponse'; import { SimpleBootHttpServer } from '../SimpleBootHttpServer'; import { TransactionManager } from '@dooboostore/core/transaction/TransactionManager'; export type Listen = { port?: number; hostname?: string; backlog?: number; listeningListener?: (server: SimpleBootHttpServer, httpServer: HttpServer | HttpsServer) => void; }; export interface ListenData extends Listen { port: number; hostname: string; } export declare class HttpServerOption extends SimOption { static readonly DEFAULT_PORT = 8081; static readonly DEFAULT_HOSTNAME = "127.0.0.1"; serverOption?: ServerOptions | HttpsServerOption; listen: ListenData; filters?: (Filter | ConstructorType<Filter>)[]; fileUploadTempPath?: string; requestEndPoints?: (EndPoint | ConstructorType<EndPoint>)[]; closeEndPoints?: (EndPoint | ConstructorType<EndPoint>)[]; errorEndPoints?: (EndPoint | ConstructorType<EndPoint>)[]; sessionOption: { key: string; expiredTime: number; provider?: { uuids: () => Promise<string[]>; delete: (uuid: string) => Promise<void>; get: (uuid: string) => Promise<{ access: number; data?: any; }>; set: (uuid: string, data: { access: number; data?: any; }) => Promise<void>; }; }; globalAdvice?: any | ConstructorType<any>; noSuchRouteEndPointMappingThrow?: (rr: RequestResponse) => any; transactionManagerFactory?: () => TransactionManager; constructor({ serverOption, listen, filters, requestEndPoints, closeEndPoints, errorEndPoints, sessionOption, globalAdvice, fileUploadTempPath, noSuchRouteEndPointMappingThrow, transactionManagerFactory }?: { serverOption?: ServerOptions | HttpsServerOption; listen?: Listen; filters?: (Filter | ConstructorType<Filter>)[]; requestEndPoints?: (EndPoint | ConstructorType<EndPoint>)[]; closeEndPoints?: (EndPoint | ConstructorType<EndPoint>)[]; errorEndPoints?: (EndPoint | ConstructorType<EndPoint>)[]; sessionOption?: { key?: string; expiredTime?: number; provider?: { uuids: () => Promise<string[]>; delete: (uuid: string) => Promise<void>; get: (uuid: string) => Promise<{ access: number; data?: any; }>; set: (uuid: string, data: { access: number; data?: any; }) => Promise<void>; }; }; globalAdvice?: any | ConstructorType<any>; fileUploadTempPath?: string; noSuchRouteEndPointMappingThrow?: (rr: RequestResponse) => any; transactionManagerFactory?: () => TransactionManager; }, initSimOption?: InitOptionType); get hostname(): string; get port(): number; get protocol(): "http" | "https"; get address(): string; get isSecure(): boolean; } //# sourceMappingURL=HttpServerOption.d.ts.map