fix(core): update

This commit is contained in:
2021-01-23 04:22:47 +00:00
parent ad8ff504a9
commit e7176ebc79
3 changed files with 93 additions and 132 deletions

View File

@ -1,4 +1,5 @@
import * as plugins from './typedsocket.plugins';
import type * as smartexpress from '@pushrocks/smartexpress';
const publicRoleName = 'publicRoleName';
const publicRolePass = 'publicRolePass';
@ -11,7 +12,7 @@ export class TypedSocket {
*/
public static async createServer(
typedrouterArg: plugins.typedrequest.TypedRouter,
smartexpressServerArg?: any
smartexpressServerArg?: smartexpress.Server
): Promise<TypedSocket> {
const smartsocketServer = new plugins.smartsocket.Smartsocket({
port: 3000,
@ -58,7 +59,9 @@ export class TypedSocket {
},
smartsocketServer
);
if (smartexpressServerArg && smartexpressServerArg.serverStatus !== 'running') {
await smartexpressServerArg.start()
}
await smartsocketServer.start();
return typedsocket;