Every Request consists of Asynchronous and Synchronous Execution.
// Load HTTP module
const http = require("http"); const hostname = "127.0.0.1";
const port = 5000; // Create HTTP server
const server = http.createServer(function(req, res) { // Set the response HTTP header with HTTP status and Content type
res.writeHead(200, {'Content-Type': 'text/plain'}); // Send the response body "Hello World"
res.end('Hello World\n');
}); // Prints a log once the server starts listening
server.listen(port, hostname, function() {
console.log(`Server running at http://${hostname}:${port}/`);
}) 2. Save the file in the folder you created above.
3. Go back to the terminal and type the following command:
Code: node hello.js
Finally, navigate to http://localhost:5000 in your web browser; you should see the text “Hello World” in the upper left of an otherwise empty web page. If you want to build your own web shop or have questions relating to e-commerce development platforms or apps, read our blog posts for Shopify and Shopware. Our dedicated outsourcing team can be your collaborator in e-commerce.