There are many frameworks that help to make the process of making a node.js powered full stack application a quick process compared to working with just the core node.js modules. I might prefer to use hapi, or express, but still it is important to at least write a few simple demos using just the node.js http module.
For a basic hello world example I made a new instance of a server object, by calling http.createServer, and then used the ‘request’ event with the server object to respond to any incoming request with ‘hello world’ by way of res.end. Finally the server is started my calling server.listen, and giving a port to listen on.
When making a simple project that will end up doing something with post requests there is a need to process the incoming body of the post request. That is to parse the body into an Object that can be worked with.
To do this there is the ‘data’, and ‘end’ events that can be used with a request object to concatenate the incoming Buffer chunks into a single String or Buffer, and then do something with the payload before sending a response.
There are many npm packages for this that may help to make requests easier, or add helpful features, but it is not to hard to just make requests from node.js with the built in http module.
This basic example will make a get request for www.google.com