Ad

Confusion About App.listen(port, Hostname) And Server.createServer()

- 1 answer

I know that app.listen(port, hostname) makes the system listen for a specific socket but do I write this code in the client-side computer or server-side computer? Also server.createServer() creates a server but is this code written in the client-side computer or server-side computer?? (this confusion happened because I was localhosting and my computer was both client-side and server-side at the same time).

Ad

Answer

Both of those pieces of code go on the server-side.

Ad
source: stackoverflow.com
Ad