0% found this document useful (0 votes)
4 views3 pages

NodeJS Lab Program - IX Observation

The document outlines the creation of a custom server using the Node.js http module, along with an exploration of the OS and path modules. It explains core concepts of the http module, including handling HTTP requests and responses, as well as details about the OS module's system information and the path module's file path operations. The project structure includes a file named httpmodule.js that contains the relevant code snippets for these functionalities.

Uploaded by

vlingaraju.aiml
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

NodeJS Lab Program - IX Observation

The document outlines the creation of a custom server using the Node.js http module, along with an exploration of the OS and path modules. It explains core concepts of the http module, including handling HTTP requests and responses, as well as details about the OS module's system information and the path module's file path operations. The project structure includes a file named httpmodule.js that contains the relevant code snippets for these functionalities.

Uploaded by

vlingaraju.aiml
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Write in

NodeJS
Observation
9. Create a custom server using http module and explore the other modules of

Node JS like OS,path, event.

AIM: Create a custom server using http module and explore the other modules of Node JS
like OS, path.

DESCRIPTION: Create a custom server using http module and explore the other modules
of Node JS like OS, path.

PROJECT STRUCTURE:

1. [Link]:- It contains http module connection snippet and other modules of Node JS
like OS, path.

1. HTTP Module:
 The http module in [Link] allows you to create web servers and handle HTTP
requests and responses.
 It is fundamental for building server-side applications that interact with browsers or
other clients over the internet.
Core Concepts:
 HTTP: stands for HyperText Transfer Protocol, which is the foundation of data
communication on the web.
 Server: A program that listens for incoming HTTP requests, processes them, and
sends back appropriate responses.
 Request (req): Contains information about the HTTP request, like the method (GET,
POST, etc.), URL, headers, and query parameters.
 Response (res): Represents the server’s response that is sent back to the client.
2. OS Module:
 The os module provides information about the operating system where the [Link]
application is running.
Core Concepts:
 Platform: The type of operating system (win32 for Windows, linux for Linux, darwin
for macOS).
 Architecture: The CPU architecture of the operating system (x64, arm, etc.).
 Memory: Methods like [Link]() and [Link]() provide details about total
and free system memory.
 CPU: [Link]() provides information about each CPU/core, which can be useful for
understanding the system’s processing power.
3. Path Module:
 The path module helps in working with file and directory paths, making file operations
simpler and more consistent across different operating systems.
Core Concepts:
• Absolute and Relative Paths: Paths can be relative to a directory or absolute
• Directory Name ([Link]()): Extracts the directory part from a file path.
• File Name ([Link]()): Extracts the base name (file name with extension)
from a path.
• File Extension ([Link]()): Retrieves the file extension from a file name.

You might also like