Relative Content

Tag Archive for typescriptwebsocketvitesveltekitws

How can I use a websocket server in my production svelte-kit app?

In my current project, I need to use a websocket server (using the ws library) in my svelte-kit application. I have successfully set up the websocket server to run automatically with npm run dev (in my vite.config.ts). But, when I build the application and run npm run preview, I don’t see the console.logs from my websocket server anymore. How can I fix this and get the server to just run in the prod environment?