Answer the question
In order to leave comments, you need to log in
How does import\export work?
sockets.js (example taken from here )
import WebSockets from "ws";
const wss = new WebSocket.Server({ port: 8080 });
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {
console.log('received: %s', message);
});
ws.send('something');
});
export {
wss
}
import {wss} from './sockets';
node sockets
, but if node index
it is not launched through ?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question