🚀 Node.js Application with Docker
🚀 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 (/).
- 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.
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
Before you begin, ensure you have the following installed:
- Node.js: v18.20.2 or higher
- NPM: v10.9.2 or higher
Follow these steps to set up the project on your local machine:
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"
}