Explorar el Código

♻️ refactor(server): clean up socket.io server initialization code

- remove unnecessary else clause and simplify conditional check
- delete commented-out socket.io configuration code to reduce clutter
- add import.meta.hot check to handle development environment properly
yourname hace 5 meses
padre
commit
604bc836bb
Se han modificado 1 ficheros con 1 adiciones y 12 borrados
  1. 1 12
      src/server/index.tsx

+ 1 - 12
src/server/index.tsx

@@ -102,19 +102,8 @@ if(import.meta.env.PROD){
     },
     fetch: app.fetch
   }
-}else{
+}else if(!import.meta.hot){
   new SocketIOServer({});
   exportDefault = app;
 }
 export default exportDefault
-
-// export default {
-//   httpServer: (httpServer) => {
-//     const io = new SocketIOServer(httpServer);
-//     console.log(io)
-//     io.on('connection', (socket) => {
-//       console.log(`Socket.IO client connected: ${socket.id}`)
-//     })
-//   },
-//   fetch: app.fetch
-// }