Skip to content

Cherry-Network/backend-express-ts-template

Repository files navigation

Express + TypeScript Backend Template

A secure, rate-limited REST API backend template built with Express and TypeScript. Includes enhanced logging, IP detection, and security best practices.

Features

  • Express.js with TypeScript
  • Security headers via helmet
  • CORS enabled
  • Rate limiting (100 requests per 15 minutes per IP)
  • Enhanced request logging with IP detection
  • Graceful shutdown handling
  • Centralized error handling

Getting Started

Prerequisites

  • Node.js (v18+ recommended)
  • npm

Installation

npm install

Environment Variables

Create a .env file in the root directory. Example:

PORT=3000
NODE_ENV=development

Development

Start the server with hot-reloading:

npm run dev

Build

Compile TypeScript to JavaScript:

npm run build

Production

Start the compiled server:

npm start

License

See LICENSE.

About

A REST API backend template built with Express and TypeScript. Includes enhanced logging, IP detection, and security best practices.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors