+
Skip to content

jacobwgillespie/zap

Repository files navigation

⚡ zap

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.

About

⚡ A lightweight HTTP server framework for Node.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载