UNPKG

@lottojs/lotto

Version:

Simple, lightweight and dependency-free NodeJS web application framework.

21 lines (20 loc) 714 B
import { NextFunction as CallbackFunction, Handler } from '../router/router.types'; import { SecurityHeaders } from '@lottojs/secure-headers/lib/core/types'; import { CorsObject } from '@lottojs/cors/lib/core/types'; export interface ServerOptions { port?: number; host?: string; cors?: CorsObject; secureHeaders?: SecurityHeaders; } export interface AbstractServer { create: (handler: Handler) => void; listen: (callback?: CallbackFunction) => void; } export declare class Server implements AbstractServer { private server?; private options; constructor({ port, host, cors }: ServerOptions); create(handler: Handler): void; listen(callback?: CallbackFunction): void; }