UNPKG

@pushrocks/smartnginx

Version:

control nginx from node, TypeScript ready

52 lines (51 loc) 1.52 kB
import * as plugins from './smartnginx.plugins'; import { NginxHost } from './smartnginx.classes.nginxhost'; import { NginxProcess } from './smartnginx.classes.nginxprocess'; import { IHostConfig } from './interfaces/hostconfig'; export interface ISmartNginxContructorOptions { logger?: plugins.smartlog.Smartlog; defaultProxyUrl: string; } /** * main class that manages a NginxInstance */ export declare class SmartNginx { options: ISmartNginxContructorOptions; logger: plugins.smartlog.Smartlog; private deployedHosts; private hostCandidates; nginxProcess: NginxProcess; constructor(optionsArg: ISmartNginxContructorOptions); /** * add a host * @param nginxHostArg */ addHostCandidate(optionsArg: IHostConfig): NginxHost; /** * Gets a NginxHost by hostname * @param hostNameArg */ getDeployedNginxHostByHostName(hostNameArg: string): NginxHost; /** * listHosts */ listDeployedHosts(): Promise<NginxHost[]>; /** * remove a Host * @param nginxHostArg */ removeDeployedHost(nginxHostArg: NginxHost): Promise<void>; /** * check wether there has been a diverging host configuration * this function will only redeploy the nginx configuration in case there has been a change */ private areHostsDiverged; /** * deploy the current stack and restart nginx */ deploy(): Promise<void>; /** * stops the smartnginx instance */ stop(): Promise<void>; }