Skip to content

sinan-keskin/node-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

🟩 node-api

A simple and modern Express-based REST API example
Includes validation, security middleware, and a minimal testing setup.

Node Express


🧩 Features

  • 🛡 Security middleware: CORS, Helmet, Rate-limit
  • 🧪 Request validation using Zod
  • 🧫 Testing setup with Vitest
  • ⚡ Minimal and clean Express server structure
  • 🔍 Includes /health endpoint for quick checks

📦 Example

import express from "express";

const app = express();

app.get("/health", (_, res) => res.json({ ok: true }));

app.listen(3000, () => console.log("Server ready 🚀"));

🚀 Getting Started

Install dependencies

npm install

Run the server

node index.js

With nodemon (optional)

npm install -g nodemon
nodemon index.js

🧪 Testing

npm test

Vitest is included for lightweight and fast test execution.

📁 Project Structure

node-api/
│── index.js
│── package.json
└── README.md

🎯 Goal

To provide a minimal yet complete Express REST API template featuring:

  • Modern middleware
  • Input validation
  • A lightweight testing environment
  • Beginner-friendly clean code

Perfect for learning, prototyping, or starting small backend projects.

About

Express-based REST API example with validation and security.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors