Node.js

Using EJS to Template Your Node Application

What is EJS? EJS (Embedded JavaScript) is a simple templating language that lets you generate HTML markup with plain JavaScript. It allows you to include dynamic content and logic in your HTML pages without the overhead of a full client-side framework. Setting Up Your Node Application First, ensure that you have Node.js and npm installed …

Using EJS to Template Your Node Application Read More »

Displaying an Image on a Web Page using Node.js and Express

Serving Static Files To display images or any other static files (CSS, JavaScript, etc.), you need to instruct Express to serve a static directory. Let’s create a folder called public: mkdir public Configuring Express for Static Assets Update your app.js to serve static files from the public directory: // Serve static files from the ‘public’ …

Displaying an Image on a Web Page using Node.js and Express Read More »

Include Functions from other files in Node.js

In Node.js, you can include functions or any other exports from other files using the require or import statements, depending on whether you are using CommonJS or ES modules. Here’s a detailed guide: 1. Using CommonJS (Default in Node.js) To include functions from another file: Step 1: Export the Function In the file you want …

Include Functions from other files in Node.js Read More »

Understanding the Exit Process in Node.js

In this article, we’ll explore a basic Node.js concept that allows your application to keep running indefinitely. We’ll learn how to use a simple setInterval function to simulate a process that continues to execute until it’s manually terminated. If you’ve ever wondered how to keep your Node.js program alive until you decide to stop it, …

Understanding the Exit Process in Node.js Read More »

Submit a form in post method in Node.js

<!DOCTYPE html> <html lang=”en”> <head>   <meta charset=”UTF-8″>   <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>   <title>Form Submission</title> </head> <body>   <h1>Submit Form</h1>   <form action=”/submit” method=”POST”>     <label for=”name”>Name:</label>     <input type=”text” id=”name” name=”name” required><br><br>     <label for=”email”>Email:</label>     <input type=”email” id=”email” name=”email” required><br><br>     <button type=”submit”>Submit</button>   </form> </body> </html> …

Submit a form in post method in Node.js Read More »

JPG to PDF converter web app

JPG to PDF converter  The JPG to PDF converter is a lightweight, user-friendly platform designed to help users convert their JPG images into PDF documents seamlessly. This project aims to bridge the gap between individual image files and organized PDF documents, providing an intuitive and efficient solution for users who need to compile images into a standardized …

JPG to PDF converter web app Read More »

Scroll to Top