mirror of
https://github.com/hexolan/panels.git
synced 2026-03-26 20:41:15 +00:00
12 lines
442 B
TypeScript
12 lines
442 B
TypeScript
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());
|
|
} |