I have an error Not running only when I start my app.js on my server, it works on localhost.
My code is there : Github
Error: Not running
at Server.close (net.js:1233:11)
at Object.<anonymous> (/home/Nahis_Wayard/summoner-infos/app.js:13:10)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
Edit: I remove the 'server.close()' and now it works everywhere
Thanks for your help !
In your
app.js, this codevar server = http.createServer(app);is used.However, the
http.createServer()is async function, it returns a new instance ofhttp.Server, andhttp.serverinherits fromnet.Serverand has the additionalevents.So call
server.close()could cause the errorError: Not runningin your case.Here is one sample codes shown the
close()is invoked.