-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67ecf16
commit 078354b
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# ⚡ zap | ||
|
||
Zap is a lightweight HTTP server framework for Node. | ||
|
||
## Installation | ||
|
||
Install with your favorite package manager: | ||
|
||
```shell | ||
$ yarn add zap | ||
$ pnpm add zap | ||
$ npm install zap | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
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) | ||
``` | ||
|
||
## License | ||
|
||
MIT License, see `LICENSE`. |