wooks
v0.5.18
Published
wooks
Downloads
1,410
Maintainers
Readme
Wooks
!!! This is work-in-progress library, breaking changes are expected !!!
Wooks is a Event Processing Framework based on composable (hooks) functions.
wooks
+ @wooksjs/event-http
= Web Application Framework with hooks.
As an alternative for express
and fastify
, wooks
brings the whole different approach for processing http requests.
It utilizes such a technique as you can see in React Hooks or Vue Composables. It has only a dependency on @prostojs/router (an alternative to find-my-way
used by fastify
) which is a very fast (see benchmarks here) and robust URI router.
HTTP Composables packs:
- @wooksjs/event-http - HTTP event package with core functionality
- @wooksjs/http-body - to parse body
- @wooksjs/http-static - to serve static files
- @wooksjs/http-proxy - to proxy requests
Installation
npm install wooks
Quick Start with a Web App
npm install wooks @wooksjs/event-http
import { useRouteParams } from 'wooks'
import { createHttpApp } from '@wooksjs/event-http'
const app = createHttpApp()
app.on('GET', 'hello/:name', () => `Hello ${useRouteParams().get('name')}!`)
// shortcuts for some methods are supported:
// app.get('hello/:name', () => `Hello ${ useRouteParams().get('name') }!`)
app.listen(3000, () => {
console.log('Wooks Server is up on port 3000')
})
See full documentation for http event here
Documentation
To check out docs, visit wooks.moost.org.