Skip to main content

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 (or QServerEventRoute for Server-Sent Events) and be decorated with Decorators.Route.Route(path); endpoint methods use Decorators.Endpoint.GET/POST/PUT/PATCH/DELETE(path).
  • @quik/http only 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 IQHTTPEngine feature is only initialized when the bootstrap startHttpServer flag is set.
  • Endpoint handlers receive a QEvent (typed as IQEvent) exposing validated body/query/path, request metadata, scoped service resolution, translation helpers, and cookie helpers (getCookie/setCookie/clearCookie).