Skip to content

Latest commit

Β 

History

History
80 lines (51 loc) Β· 2.06 KB

File metadata and controls

80 lines (51 loc) Β· 2.06 KB

node-js-application

πŸš€ Node.js Application with Docker

Node.js Application

πŸš€ Node.js Express Application

This project is a simple Node.js Express application that serves a basic REST API. It returns a JSON response when accessed at the root URL (/).

πŸ“„ Project Overview

  • Purpose: Demonstrates how to set up a basic Node.js Express server.
  • Functionality: Responds with a JSON object when accessed at the root URL (/).
  • Key Features:
    • Lightweight and fast using Express.js.
    • Automatically installs required dependencies with npm install.
    • Configurable port using environment variables (default: 8000).
    • Suitable for quick API prototyping or serving lightweight applications.

πŸ“š Project Structure

node-js-application/ β”œβ”€β”€ node_modules/ # Node modules directory (auto-generated) β”œβ”€β”€ index.js # Main application file β”œβ”€β”€ package.json # Project dependencies and metadata β”œβ”€β”€ package-lock.json # Auto-generated lock file └── README.md # Project documentation

πŸ–₯️ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js: v18.20.2 or higher
  • NPM: v10.9.2 or higher

⚑️ Installation Guide

Follow these steps to set up the project on your local machine:

πŸ“ Step 1: Clone the Repository

git clone [https://github.com/nagenbiswal123/node-js-application.git](https://www.google.com/search?q=https://github.com/nagenbiswal123/node-js-application.git)



πŸ“‚ Step 2: Navigate to the Project Directory
Bash

cd node-js-application

πŸ“¦ Step 3: Install Dependencies
Bash

npm install
This command installs all the required packages listed in package.json.

▢️ Step 4: Run the Application
Bash

npm start
The server will start running on http://localhost:8000.

πŸ”₯ Testing the Application
Access the API
Open your web browser or use a tool like Postman or curl to make a request:

Bash

GET http://localhost:8000/


βœ… Response:
JSON

{
  "status": "Success",
  "message": "Hello from express server"
}