Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How can I deploy SvelteKit IO app with two ports?

$
0
0

I'm using the SvelteKit IO library for sockets in my SvelteKit application.

My main application, when built, runs on port 4173. My socket runs on 3001.

Here's the SKIO setup code: I can't change 3001 to 4173 without encountering an error.

skio.setup('http://localhost:3001', {    cors: {        origin: "http://localhost:4173",        credentials: true,    },}).then(io => {    if (browser)        return;    io.on('connect', socket => {        socket.on('message', (message) => {            if (message.game_stop === true) {                socket.disconnect()            } else {                socket.emit('message', message);                socket.broadcast.emit('message', message);            }        });    });});

How do I deploy such an app with two ports?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>