Get Started with Web App
INFO
Learn more about Wooks to understand its philosophy and advantages:
Or you can get hands-on with the HTTP flavor of Wooks right now.
Installation
npm install @wooksjs/event-httpThis gives you access to the Wooks core library and the HTTP adapter, which provides a simple, Express-like API for creating HTTP servers while leveraging Wooks’ composable and context-driven patterns.
Creating Your First "Hello World" App
In this example, we’ll create an HTTP server that responds to GET /hello/:name with a personalized greeting.
Example:
import { createHttpApp, useRouteParams } from '@wooksjs/event-http'
const app = createHttpApp()
// Register a route handler using the GET method shortcut:
app.get('hello/:name', () => `Hello ${useRouteParams().get('name')}!`)
// Start the server on port 3000
app.listen(3000, () => {
// Use the built-in logger to print a startup message
app.getLogger('[App]').log('Wooks Server is up on port 3000')
})Test It:
curl http://localhost:3000/hello/World
# Hello World!Using Node’s http Server Directly
You can create http(s) server manually and pass the server callback from the Wooks HTTP app. Use getServerCb() to plug Wooks into an http server of your own.
Example:
import { createHttpApp, useRouteParams } from '@wooksjs/event-http'
import http from 'http'
const app = createHttpApp()
app.get('hello/:name', () => `Hello ${useRouteParams().get('name')}!`)
const server = http.createServer(app.getServerCb())
server.listen(3000, () => {
app.listen(3000, () => {
console.log('Wooks Server is up on port 3000')
})Test It:
curl http://localhost:3000/hello/Wooks
# Hello Wooks!AI Agent Skills
@wooksjs/event-http ships with skill files for AI coding agents (Claude Code, Cursor, Windsurf, Codex, etc.) that provide context-aware assistance.
# Project-local (recommended — version-locked, commits with your repo)
npx wooksjs-event-http-skill
# Global (available across all your projects)
npx wooksjs-event-http-skill --globalTo keep skills automatically up-to-date, add a postinstall script to your package.json:
{
"scripts": {
"postinstall": "wooksjs-event-http-skill --postinstall"
}
}Next Steps
- Working with Request: Check out Request Composables to learn how to manipulate request data, read headers or cookies and more.
- Add Logging & Error Handling: Integrate event loggers or custom error-handling composables to make debugging easier.
- Advance to Other Flavors: Once comfortable with HTTP, consider exploring CLI or Workflow flavors for broader event-driven architectures.