UNPKG

1.18 kBTypeScriptView Raw
1import { Interfaces, LogType } from '@lxdhub/common';
2import { IDatabaseSettings } from '@lxdhub/db';
3import { Application } from 'express';
4/**
5 * The LXDHub API settings
6 */
7export declare class LXDHubAPISettings {
8 port?: number;
9 hostUrl?: string;
10 database: IDatabaseSettings;
11 lxd?: Interfaces.ILXDRemoteAuthentication;
12 logLevel?: LogType;
13 docUrl: string;
14}
15/**
16 * The LXDHub API is the interface for the
17 * LXDHub Web user interface.
18 */
19export declare class LXDHubAPI implements Interfaces.ILXDHubHttpService {
20 private settings;
21 private server?;
22 private app;
23 private logger;
24 private url;
25 constructor(settings: LXDHubAPISettings, server?: Application);
26 /**
27 * Conigurates Swagger for Nest
28 */
29 private setupSwagger;
30 /**
31 * Creates the Nest App
32 */
33 private createNestApp;
34 /**
35 * Setup the middleware for LXDHub API
36 */
37 private setupMiddleware;
38 /**
39 * Bootstraps the LXDHub API and returns the
40 * Express instance
41 */
42 bootstrap(): Promise<Application>;
43 /**
44 * Bootstraps & starts LXDHub API with the given conifgurations
45 */
46 run(): Promise<void>;
47}