Skip to content

rohit-ups/nodeAppp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express MongoDB Application

A minimal Express.js application with MongoDB connection, health check endpoint, and basic configuration.

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or Atlas)

Setup Instructions

  1. Clone the repository
git clone 
cd express-mongo-app
  1. Install dependencies
npm install
  1. Configure environment variables
# Copy the example .env file and modify it with your MongoDB connection details
cp .env.example .env
# Edit the .env file with your MongoDB connection string
  1. Start the development server
npm run dev
  1. For production use
npm run build
npm start

Project Structure

.
├── package.json        # Project dependencies and scripts
├── .env                # Environment variables
├── src/
│   ├── index.js        # Main application file
│   ├── routes.js       # API routes
│   └── models/         # MongoDB models
│       └── user.js     # Example user model

Available Endpoints

  • GET / - Health check endpoint
  • GET /api/hello - Example API endpoint

Scripts

  • npm start - Start the server in production mode
  • npm run dev - Start the server in development mode with hot-reloading
  • npm run build - Build the project for production deployment

Environment Variables

  • PORT - Server port (default: 3000)
  • MONGODB_URI - MongoDB connection string

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors