workadventure/back/server.ts
2020-12-02 17:51:46 +01:00

14 lines
488 B
TypeScript

// lib/server.ts
import App from "./src/App";
import grpc from "grpc";
import {roomManager} from "./src/RoomManager";
import {IRoomManagerServer, RoomManagerService} from "./src/Messages/generated/messages_grpc_pb";
App.listen(8080, () => console.log(`WorkAdventure starting on port 8080!`))
const server = new grpc.Server();
server.addService<IRoomManagerServer>(RoomManagerService, roomManager);
server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
server.start();