partey_workadventure/back/server.ts
Gregoire Parant 8b758a0053 Merge branch 'develop' into 2daysLimit
Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
2022-01-05 11:47:31 +01:00

16 lines
667 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";
import { HTTP_PORT, GRPC_PORT } from "./src/Enum/EnvironmentVariable";
App.listen(HTTP_PORT, () => console.log(`WorkAdventure HTTP API starting on port %d!`, HTTP_PORT));
const server = new grpc.Server();
server.addService<IRoomManagerServer>(RoomManagerService, roomManager);
server.bind(`0.0.0.0:${GRPC_PORT}`, grpc.ServerCredentials.createInsecure());
server.start();
console.log("WorkAdventure HTTP/2 API starting on port %d!", GRPC_PORT);