Skip to content

Commit f59c810

Browse files
committed
update main
1 parent 883349c commit f59c810

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

apps/server/src/main.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import cors from "@fastify/cors";
2-
import ws from "@fastify/websocket";
31
import {
42
type FastifyTRPCPluginOptions,
53
fastifyTRPCPlugin,
@@ -31,7 +29,7 @@ const server = fastify({
3129
trustProxy: env.TRUSTED_PROXIES,
3230
});
3331

34-
await server.register(ws, {
32+
await server.register(import("@fastify/websocket"), {
3533
preClose(done) {
3634
console.log("Broadcasting reconnect to clients before shutdown");
3735
const response: TRPCReconnectNotification = {
@@ -64,7 +62,7 @@ server.websocketServer.on("connection", (ws, req) => {
6462

6563
// Allow CORS for dev
6664
if (process.env.NODE_ENV !== "production") {
67-
await server.register(cors, {
65+
await server.register(import("@fastify/cors"), {
6866
origin: "*",
6967
credentials: true,
7068
});

0 commit comments

Comments
 (0)