cf8f2cb1 by Glitch (hello-express)

:construction_site::jack_o_lantern: Checkpoint

./server.js:13690106/227
1 parent d2d856d0
......@@ -12,13 +12,16 @@ var wss_event = new WebSocket.Server({ noServer: true});
server.on('upgrade', async function (request, socket, head) {
var pathname = url.parse(request.url).pathname || '/gun';
console.log('Got WS request',pathname);
var gun = false;
if (pathname){
if (lru.has(pathname)){
// Existing Node
console.log('Recycle id',pathname);
gun = await lru.get(pathname);
} else {
// Create Node
console.log('Create id',pathname);
gun = await Gun({peers:[], ws: { noServer: true}});
lru.set(pathname,gun);
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!