Skip to content

HideInHere/express-api-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-api-starter

A lightweight, production-ready starter template for building RESTful APIs with Node.js and Express. Includes essential middleware, error handling, and a structured project layout.

Features

  • Express.js setup with common middleware
  • Centralized error handling
  • Environment-based configuration
  • Request validation and sanitization
  • CORS and rate limiting configured
  • Docker support included

Installation

git clone https://github.com/yourusername/express-api-starter.git
cd express-api-starter
npm install
cp .env.example .env

Quick Start

npm run dev

The API will be available at http://localhost:3000

Example Usage

const app = require('./app');

app.get('/api/users/:id', (req, res) => {
  res.json({ id: req.params.id, name: 'John Doe' });
});

Project Structure

src/
├── routes/
├── middleware/
├── controllers/
├── utils/
└── server.js

License

MIT

About

Production-ready Express.js REST API boilerplate with JWT auth, error handling, and modular routing

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors