0% found this document useful (0 votes)
11 views2 pages

Node - Js - Final Lab Program List

The document outlines a list of programs for a Node.js final lab exam for MCA 3rd semester. It includes tasks such as creating HTTP servers, handling file uploads, integrating EventEmitter, connecting to a PostgreSQL database, and building REST APIs for articles with various operations. Additionally, it mentions a focus on authentication and security in one of the programs.

Uploaded by

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

Node - Js - Final Lab Program List

The document outlines a list of programs for a Node.js final lab exam for MCA 3rd semester. It includes tasks such as creating HTTP servers, handling file uploads, integrating EventEmitter, connecting to a PostgreSQL database, and building REST APIs for articles with various operations. Additionally, it mentions a focus on authentication and security in one of the programs.

Uploaded by

shettyyashwin569
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MCA- 3rd Sem Node.

js Final Lab Exam Programs List

1. Create a simple HTTP server that responds with "Hello, World!" for all requests.

2. Create a server and upload a file to the server via a HTML file, and the server saves
the uploaded file to the server's filesystem.

3. Integrate EventEmitter with an Express server. Emit a custom event for each
incoming HTTP request and write a listener that logs the request details.

4. Write a Node.js program that connects to a PostgreSQL database and performs the
following operations:
• Ask the user to choose an operation:
a) Insert data,
b) Update data
c) Delete data
d) View all data
e) Exit
• Perform the corresponding operation based on the user's choice: Repeat the
process until the user chooses to exit.

5. Create a Node.js program using Express that allows users to download a file. Your
program should have the following endpoint:
• /download/:filename: Accepts a GET request with a parameter filename.
• The program should read the file with the given filename from the server's file
system and send it as a response.
• If the file does not exist, respond with a 404 status code and a message "File not
found".

6. Create an HTTP server that handles JSON data sent in a POST request and serves
an HTML file.

7. Build a REST API to Create (POST) and Fetch All Articles (GET) using Express
• Create a POST endpoint/article to insert new article data into PostgreSQL.
• Create a GET endpoint /articles to fetch all articles from PostgreSQL.
• Test both APIs using Postman.
• Output: Successfully inserted article should return a JSON object, and GET
should return all articles.
8. Build a REST API to Fetch Specific Article (GET) and updating articles using PUT and
PATCH methods using Express
a. Implement the route /articles/:id to fetch article by ID.
b. Implement a PUT route /article/:id to update the entire article.
c. Implement a PATCH route /article/:id to update partial fields of the article.
d. Test both endpoints via Postman by updating existing articles.

9. Build a REST API to Creating new Article, Delete a Single Article (Row) and all the
Articles (Rows) with POST and DELETE methods using Express
a. Create a DELETE route /article/:id to delete single article by id.
b. Test deletion of an article and handle cases when the article does not exist.
c. Create DELETE route /articles to delete all articles.
d. Test the API via Postman and verify deletion by calling GET /articles (should
return empty array).

10. Will be based on Authentication and Security

You might also like