Courses / Node.js
1. Creating an http.Server with Node.js
Instantiate and start a basic HTTP server using Node's http.createServer and server.listen.
1 min read Chapter 1 of 48
JavaScript
Creating an http.Server with Node.js
A simple Node.js HTTP server listens for requests and sends back responses over TCP.
"I need a tiny server to handle webhooks and return JSON without a full framework."
Use Node's built-in http.createServer to make a server object that handles incoming requests; call server.listen to accept connections on a port.
"I need a tiny server to handle webhooks and return JSON without a full framework."
Use Node's built-in http.createServer to make a server object that handles incoming requests; call server.listen to accept connections on a port.