get server()

in src/app/webserver/webserver.component.ts [64:97]


    get server(): Promise<WebServer> {
        return new Promise<WebServer>((resolve, reject) => {
            this.service.server.catch(e => {
                if (e instanceof UnexpectedServerStatusError) {
                    this.notifications.confirm(
                        `Start Microsoft IIS Administration API`,
                        `Microsoft IIS Administration API is currently ${e.Status}. Do you want to start the service?`).then(confirmed => {
                        if (confirmed) {
                            this.runtime.StartIISAdministration().subscribe(
                                _ => {
                                    this.service.server.catch(ex => {
                                        reject(this.failure = `Unable to start Microsoft IIS Administration API Service, error ${ex}`)
                                        throw ex
                                    }).then(s => {
                                        resolve(s)
                                    })
                                },
                                _ => {
                                    reject(this.failure = `Unable to start Microsoft IIS Administration API Service, error: ${e}`)
                                },
                            )
                        } else {
                            reject(this.failure = `Web Server Module cannot be initialized. Current Microsoft IIS Administration API Service status: ${e.Status}`)
                        }
                    })
                } else {
                    reject(this.failure = `Unknown error has occurred when trying to initialize Web Server Module: ${JSON.stringify(e)}`)
                }
                throw e
            }).then(ws => {
                resolve(ws)
            })
        })
    }