Docs Examples Whitepaper GitHub

Example Projects

Real-world use cases built with Nextpress. Each runs standalone with zero external dependencies - just clone and node server.js.

Todo API

Classic CRUD REST API with filtering, validation, and proper HTTP status codes. The "hello world" of backend frameworks.

routing jsonParser() status codes notFound() onError() query params
localhost:3001
localhost:3001
Set up Nextpress project
Define API routes
Add input validation
Write integration tests
Deploy to production
3 items left · 2 completed
$ node examples/todo-api/server.js
:3001

Auth API

User registration and login with token-based authentication. Demonstrates the auth guard middleware pattern with route groups.

group() middleware chains req.header() auth guard custom logger
localhost:3002
localhost:3002/login
Sign in
$ node examples/auth-api/server.js
:3002

File Upload Service

Upload, download, and manage files with a web UI. Raw binary streaming, traversal protection, and static file serving for the frontend.

serveStatic() raw streaming path traversal guard req.params web UI
localhost:3003
localhost:3003
Click to upload a file
Max 10 MB per file
·report.pdf239 KB↓ download
·photo.jpg1.0 MB↓ download
·notes.txt1.2 KB↓ download
$ node examples/file-upload-service/server.js
:3003

Webhook Proxy

Receive webhooks from any source, validate signatures, apply rate limiting, and fan out. Features a debug catch-all that echoes any request.

cors() all() wildcard routes rate limiter request ID signature validation
localhost:3004
localhost:3004/dashboard
Incoming Webhooks
github
push → refs/heads/main
2s ago
200
stripe
payment.success $49.00
15s ago
200
slack
message.posted #general
1m ago
200
github
push → refs/heads/dev
3m ago
429
$ node examples/webhook-proxy/server.js
:3004

SPA Backend

Full-stack pattern: JSON API under /api with route groups, static serving for the built frontend, and SPA fallback that serves index.html for client-side routes.

group() serveStatic() SPA fallback notFound() pagination maxAge cache
localhost:3005
localhost:3005

Hello Nextpress

Getting started with zero-dependency HTTP framework building...

mohit · Apr 1

V8 Optimization Tricks

How prototype patching achieves hidden class stability for faster property access...

mohit · Mar 28

Radix Trees for Routing

Why trie-based routing outperforms linear scanning and regex matching...

mohit · Mar 22
$ node examples/react-spa-backend/server.js
:3005

Feature Coverage

Every Nextpress feature is demonstrated across these five projects.

Feature Todo Auth Files Webhooks SPA
GET / POST / PUT / DELETE
jsonParser() -
cors() ---
serveStatic() ---
group() ---
Route params (:id)
Wildcard routes (*) ---
Middleware chains ---
req.header() --
Query params -
notFound()
onError()
all() ----

Build something with Nextpress

Clone any example, modify it, and ship. Or start from scratch with the docs.

Get Started Read the Docs