Day 3: Learn Node.js in Malayalam – Core Modules and Creating an HTTP Server with Techflix AI

Posted by

Node.js Malayalam Tutorial | Day 3 | Techflix AI

Node.js Malayalam Tutorial – Day 3

Welcome to Day 3 of our Node.js tutorial series on Techflix AI!

Node.js Core Modules

Node.js comes with a set of core modules that provide basic functionality for building web applications, handling file operations, networking, and more. Some of the core modules include:

  • http
  • fs
  • url
  • path

Create a HTTP Server

One of the most common use cases for Node.js is to create a web server. Let’s take a look at how you can create a simple HTTP server using the built-in http module:

  
    const http = require('http');

    const server = http.createServer((req, res) => {
      res.statusCode = 200;
      res.setHeader('Content-Type', 'text/plain');
      res.end('Hello, World!');
    });

    server.listen(3000, 'localhost', () => {
      console.log('Server running at http://localhost:3000/');
    });
  

By running the above code in a Node.js file and executing it with the Node.js runtime, you can create a simple HTTP server that listens on port 3000 and responds with ‘Hello, World!’ to incoming requests.

That’s it for Day 3 of our Node.js Malayalam tutorial series! Stay tuned for more tutorials on Techflix AI.

0 0 votes
Article Rating
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@jilsonjoy98
4 months ago

❤❤❤❤

@anurashid7188
4 months ago

Thank you ❤