Login Sign Up

nodejs-rest-api-boilerplate

Created by @embedenv Updated 1 week, 2 days ago

Node.js REST API Boilerplate

A production-ready Node.js + Express REST API starter with JWT authentication, rate limiting, and CRUD endpoints.

Features

  • JWT Authentication (register + login endpoints)
  • Express Rate Limiting (100 req/15 min per IP)
  • CORS configured for cross-origin frontend apps
  • Modular route structure under /api/v1/
  • Full CRUD for posts resource
  • Health check endpoint
  • Clean JSON error responses

API Endpoints

Method Endpoint Description
POST /api/v1/auth/register Register new user
POST /api/v1/auth/login Login and get JWT
GET /api/v1/users/me Get current user profile
GET /api/v1/posts List all posts
POST /api/v1/posts Create a new post
DELETE /api/v1/posts/:id Delete a post
GET /health Server health check

Setup

npm install
npm start
# API runs at http://localhost:3000

Tech Stack

  • Node.js 20+
  • Express.js 4.18
  • express-rate-limit
  • CORS middleware

Use Cases

  • Backend API for React/Vue/Next.js apps
  • Microservice starter template
  • REST API learning project
  • SaaS backend boilerplate

Environment Details

Environment Node.js
Visibility Public Space
Role viewer

Collaborative Workspace

You can request permission to join this workspace as a collaborator to edit code and develop in real-time.

Join Workspace

Embed Sandbox

Share this sandbox directly inside your blog posts, articles, or documentation by copying the iframe code below.

<iframe src="https://embedenv.com/embedenv/projects/nodejs-rest-api-boilerplate/?embed=true" width="100%" height="600px" style="border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;"></iframe>
Link copied!