mirror of
https://github.com/hexolan/panels.git
synced 2026-03-27 04:44:10 +00:00
init user-service
This commit is contained in:
12
services/user-service/src/rpc/server.ts
Normal file
12
services/user-service/src/rpc/server.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { fastify } from "fastify";
|
||||
import { fastifyConnectPlugin } from "@connectrpc/connect-fastify";
|
||||
|
||||
import routes from "./connect";
|
||||
|
||||
export default async function serveRPC(): Promise<void> {
|
||||
const server = fastify({ http2: true, logger: true });
|
||||
await server.register(fastifyConnectPlugin, { routes: routes });
|
||||
|
||||
await server.listen({ host: "0.0.0.0", port: 9090 });
|
||||
console.log("rpc server is listening at", server.addresses());
|
||||
}
|
||||
Reference in New Issue
Block a user