Guide
App instance
The H4 App instance is the core of your server.
Core Creation API
Use the createAPP function to create an instance of the H4 App.
createApp()
Configuration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
port | int | 3000 | HTTP listening port |
autoStart | bool | true | Automatic server startup |
onRequest | Middleware | null | Pre-processing middleware |
onError | ErrorHandler | null | Custom error handling |
afterResponse | Middleware | null | Post-processing middleware |
Lifecycle Hooks
Request Flow
onRequestmiddleware- Route handler execution
afterResponsemiddleware
Error Handling
Manual Startup Control
When autoStart: false: