Composables
A composable function, also known as a hook, is a function that connects you to the event context, which includes URL parameters, request body, cookies, and more.
Read more about What is a Wook
Wooks HTTP provides various useful composable functions that can be categorized into the following groups:
- Request Composables: Functions related to the request, such as headers, cookies, and the request body.
- Response Composables: Functions for setting the response, including headers, cookies, status, and cache control.
- Body Parser: Parsing the request body (JSON, form data, urlencoded, and more) via
@wooksjs/http-body. - Proxy Requests: Proxying requests to other servers via
@wooksjs/http-proxy. - Serve Static: Serving static files via
@wooksjs/http-static.
You can also create your own composables to encapsulate additional logic, such as retrieving user data based on cookies or authentication headers.