chore(deps): modernize coreflow tooling
This commit is contained in:
@@ -3,19 +3,29 @@ import * as plugins from './coreflow.plugins.js';
|
||||
|
||||
export class InternalServer {
|
||||
public coreflowRef: Coreflow;
|
||||
public typedsocketServer: plugins.typedsocket.TypedSocket;
|
||||
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() {
|
||||
this.typedsocketServer = await plugins.typedsocket.TypedSocket.createServer(
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user