---
id: node-api-template
title: Node.js API Template
sidebar_label: Node.js API
---

<!-- @format -->

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:
    ```bash
    npm install
    ```
2.  **Run Development Server**: Start the API server:
    ```bash
    npm run dev
    ```
    Open [http://localhost:3000](http://localhost:3000) to access your API.
