Zero-dependency
Small, Express-like API without external deps.
Pluggable parsers
json(), urlencoded(), text(), raw() built-in.
Streaming uploads
Multipart streaming to disk for large files.
Static serving
Content-Type handling and cache options.
Built-in fetch
Server-side fetch with TLS passthrough.
WebSocket
RFC 6455 with ping/pong & sub-protocols.
Server-Sent Events
Auto-IDs, named events, keep-alive.
Compression
Gzip/deflate with threshold & filter.
HTTPS & TLS
Native HTTPS, req.secure, secure routing.
Modular Router
Sub-apps, chaining, introspection.
Registration order
Middleware runs in the order registered—add parsers before handlers.
Body parsing
Populates req.body; multipart exposes req.body.files and req.body.fields.
Handler model
Handlers receive req + res. Respond with res.json() or res.send().
Static middleware
Serves files with Content-Type from extension and supports caching options.
Quickstart
Install from npm and create a simple server:
npm install zero-http
const { createApp, json, static } = require('zero-http')
const path = require('path')
const app = createApp()
app.use(json({ limit: '10kb' }))
app.use(static(path.join(__dirname, 'public'), { index: 'index.html' }))
app.get('/ping', (req, res) => res.json({ pong: true }))
app.listen(3000, () => {
console.log('Server listening on http://localhost:3000')
})
To run this demo server from the repo root and open
http://localhost:3000.
npm install zero-http
npm run docs
# open http://localhost:3000
API, Options & Examples
Options (middleware & parser settings)
Common option shapes and defaults for parsers and upload middleware.
API Reference
Simple Examples
Snippets showing how to compose middleware for common tasks.
Installation & tests
#clone and install dependencies
git clone https://github.com/tonywied17/zero-http-npm.git
npm install
# run demo server from repo root
npm run docs
# or directly:
node documentation/full-server.js
# run tests (project-specific)
node test/test.js
Extending
Use the provided middlewares and routing helpers to build controllers, add auth, or swap in different storage backends. The multipart parser exposes file streams and writes each part to disk so you can replace disk writes with S3 streams if desired.
Playground
Interactive tools to test uploads, body parsers, and the built-in proxy.
Upload multipart data
Uploaded Files
Trash
Quick parser tests
Proxy Test
WebSocket Chat
SSE Event Viewer
This demo doubles as a readable API reference and playground — try uploading files, inspect the returned JSON, and use the playground to test parsers.