Quickstart
import { Decorators, QRoute } from '@quik/http';
@Decorators.Route.Route('/health')
export class HealthRoute extends QRoute {
@Decorators.Endpoint.GET('/')
async get(event) {
return { status: 'ok' };
}
}
Notes
- Routes must extend
QRoute(orQServerEventRoutefor Server-Sent Events) and be decorated withDecorators.Route.Route(path); endpoint methods useDecorators.Endpoint.GET/POST/PUT/PATCH/DELETE(path). @quik/httponly defines the abstract engine contract (IQHTTPEngine), route decorators, and response helpers — it does not start a server by itself. Pair it with an implementation package such as@quik/http-express.- The
IQHTTPEnginefeature is only initialized when the bootstrapstartHttpServerflag is set. - Endpoint handlers receive a
QEvent(typed asIQEvent) exposing validatedbody/query/path, request metadata, scoped service resolution, translation helpers, and cookie helpers (getCookie/setCookie/clearCookie).