Skip to main content

Node.js API Template

This template provides a basic Node.js API project setup using Express.js.

Features

  • Express.js: Fast, unopinionated, minimalist web framework for Node.js.
  • nodemon: Automatically restarts the server when file changes are detected during development.

Files Included

  • src/index.js: The main entry point for your Express.js API.
  • .gitignore: Configured to ignore node_modules, .env, and other common files.
  • package.json: Configured with start and dev scripts, and necessary dependencies.

Available Scripts

In the project directory, you can run:

  • npm start: Runs the API server in production mode.
  • npm run dev: Runs the API server in development mode using nodemon for automatic restarts.

Getting Started

  1. Install Dependencies: After creating your project, install the dependencies:
    npm install
  2. Run Development Server: Start the API server:
    npm run dev
    Open http://localhost:3000 to access your API.