import * as express from "express" ; import { join as joinPath } from "path" ; import Logger from "./Logger" ; export default class BundledUIServer { static start ( ) { return new Promise ( ( ( resolve , reject ) => { const app = express ( ) ; app . use ( express . static ( joinPath ( process . resourcesPath , "../dist/ui/" ) ) ) ; const server = app . listen ( 0 , ( ) => { const port = server . address ( ) . port ; Logger . info ( "Bundled UI Server" , "Listening on port " + port ) ; resolve ( port ) ; } ) ; } ) ) ; } }