# Data flow — elysiajs/elysia

> Canonical page: https://codevetter.com/unpack/elysia/data-flow

# Data flow — elysiajs/elysia

Scanned commit e037eca710e7ad193be09cc6615ab0dbe54af914 (2026-08-26). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Registration converts developer declarations into route records and execution machinery before requests arrive. Requests enter through Fetch-compatible Request objects and acquire per-request context alongside shared application state. Parsing and schema providers transform boundary values before application handlers run. Responses cross adapter mapping, cookie serialization, streaming or WebSocket output boundaries.
- add expands macros, normalizes/prefixes paths and selects route schemas over inherited candidates before constructing route validators and compiled handlers. — [src/index.ts#L482-522](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/index.ts#L482-L522) [src/index.ts#L550-570](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/index.ts#L550-L570) [src/index.ts#L918-939](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/index.ts#L918-L939)
- WebStandard createContext extracts URL path/query positions, shares store and decorator values, and allocates request-local set headers/status. — [src/adapter/web-standard/index.ts#L147-190](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/adapter/web-standard/index.ts#L147-L190)
- Dynamic dispatch runs application request hooks first, then searches method, WebSocket method and ALL routes; missing routes receive parsed query context before NotFoundError. — [src/dynamic-handle.ts#L247-278](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/dynamic-handle.ts#L247-L278)
- Dynamic body parsing skips GET/HEAD, then places parsed body, matched params, query values and header entries into context; parseQuery preserves repeated keys as arrays. — [src/dynamic-handle.ts#L285-303](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/dynamic-handle.ts#L285-L303) [src/dynamic-handle.ts#L473-482](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/dynamic-handle.ts#L473-L482) [src/parse-query.ts#L295-323](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/parse-query.ts#L295-L323)
- Standard Schema Validate propagates value/issues results and awaits Promise results; dynamic HTTP validation replaces context fields with validated output or throws ValidationError. — [src/schema.ts#L590-630](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/schema.ts#L590-L630) [src/dynamic-handle.ts#L189-205](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/dynamic-handle.ts#L189-L205) [src/dynamic-handle.ts#L672-688](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/dynamic-handle.ts#L672-L688)
- Parsed cookies become a proxy of Cookie objects backed by request-local set.cookie; outgoing properties are serialized and handleSet installs one or multiple Set-Cookie headers. — [src/cookies.ts#L348-370](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/cookies.ts#L348-L370) [src/cookies.ts#L456-479](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/cookies.ts#L456-L479) [src/adapter/utils.ts#L437-451](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/adapter/utils.ts#L437-L451)
- Web Standard mapResponse turns arrays/objects into JSON and dispatches files, custom statuses, promises and streams to specialized handlers; byte ranges slice Blob/File responses. — [src/adapter/web-standard/handler.ts#L60-155](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/adapter/web-standard/handler.ts#L60-L155) [src/adapter/utils.ts#L19-80](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/adapter/utils.ts#L19-L80)
- WebSocket frames pass through createWSMessageParser, validation and the message callback; createHandleWSResponse resolves promises, iterates generators and serializes objects before sending. — [src/adapter/bun/index.ts#L589-624](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/adapter/bun/index.ts#L589-L624) [src/ws/index.ts#L225-255](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/ws/index.ts#L225-L255) [src/ws/index.ts#L258-305](https://github.com/elysiajs/elysia/blob/e037eca710e7ad193be09cc6615ab0dbe54af914/src/ws/index.ts#L258-L305)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
