Skip to content

⚡ A lightweight HTTP server framework for Node.

License

Notifications You must be signed in to change notification settings

jacobwgillespie/zap

Repository files navigation

⚡ zap npm CI

Zap is a lightweight HTTP server framework for Node.

Installation

Install with your favorite package manager:

$ yarn add zap
$ pnpm add zap
$ npm install zap

Usage

import {route, router, serve} from 'zap'

const app = router(
  route('GET', '/', () => 'Hello World'),

  route('GET', '/hello/:name', (req) => `Hello ${req.params.name}`),
)

const server = http.createServer(serve(app))
server.listen(3000)

Credits

Special thanks to @nornagon for the zap package name. For versions of this module published before v1.0.0, see nornagon/node-zap.

License

MIT License, see LICENSE.