Files
coreflow/ts/coreflow.classes.internalserver.ts
T

32 lines
849 B
TypeScript

import { Coreflow } from './coreflow.classes.coreflow.js';
import * as plugins from './coreflow.plugins.js';
export class InternalServer {
public coreflowRef: Coreflow;
public smartServe: plugins.smartserve.SmartServe;
public typedsocketServer!: plugins.typedsocket.TypedSocket;
constructor(coreflowRefArg: Coreflow) {
this.coreflowRef = coreflowRefArg;
this.smartServe = new plugins.smartserve.SmartServe({
port: 3000,
websocket: {
typedRouter: this.coreflowRef.typedrouter,
},
});
}
public async start() {
await this.smartServe.start();
this.typedsocketServer = plugins.typedsocket.TypedSocket.fromSmartServe(
this.smartServe,
this.coreflowRef.typedrouter,
);
}
public async stop() {
await this.typedsocketServer.stop();
await this.smartServe.stop();
}
}