Back to Blog
Hello world node js windows6/27/2023 ![]() We use the created http instance and call http.createServer() method to create a server instance and then we bind it at port 8081 using the listen method associated with the server instance. We use the require directive to load the http module and store the returned HTTP instance into an http variable as follows − ![]() Read request and return response − The server created in an earlier step will read the HTTP request made by the client which can be a browser or a console and return the response.Ĭreating Node.js Application Step 1 - Import Required Module Import required modules − We use the require directive to load Node.js modules.Ĭreate server − A server which will listen to client's requests similar to Apache HTTP Server. A Node.js application consists of the following three important components − Before creating an actual "Hello, World!" application using Node.js, let us see the components of a Node.js application.
0 Comments
Read More
Leave a Reply. |