Zap is a lightweight HTTP server framework for Node.
Install with your favorite package manager:
$ yarn add zap
$ pnpm add zap
$ npm install zap
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)
Special thanks to @nornagon for the zap
package name. For versions of this module published before v1.0.0
, see nornagon/node-zap.
MIT License, see LICENSE
.