Horje
GREPPER ANSWER Code Example
grepper answer
//working with node express many times we find cors issue even though we have installed cors package modules 
//this is the working example using with socket io 

var app = require('express')();
var http = require('http').createServer(app);
var io = require('socket.io')(http,{
	cors:{
		origin:"http://localhost:3000",
		methods: ["GET","POST"],
		allowedHeaders: [""],
		credentials: true
	}
});
const cors = require('cors');

// creating web socket
io.on('connection',(socket)=>{
	console.log('User Online');

	socket.on('canvas-data',(data)=>{
		socket.broadcast.emit('canvas-data',data);
	})
})

// const app= express();
app.use(cors());


var server_port = process.env.YOUR_PORT || process.env.PORT || 5000;
http.listen(server_port,() =>{
	console.log("Started on : "+server_port);
})
// const PORT = 3001;
// app.use(cors());


// app.get("/", (req, res)=>{
// 	res.send("hell of code");
// });

// app.listen(PORT, ()=>{
// 	console.log(`Server running on port ${server_port}`);
// })
GREPPER ANSWER
echo    >>   .txt
add grepper answer
Have you emptied the cache while reloading (usually Ctrl+F5)? Xampp not updating CSS immediately 
looking for a grepper answer
here ya go
how to use Add Grepper Answer (a)
decrypt file xml file
grepper best answer
python Flask




Shell

Related
git add and commit all Code Example git add and commit all Code Example
install kooha-screen-recorder Code Example install kooha-screen-recorder Code Example
how to leave an organisation github Code Example how to leave an organisation github Code Example
how to remove ubuntu proxy not working Code Example how to remove ubuntu proxy not working Code Example
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher. Code Example npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10