Skip to main content

Module code_routes

Module code_routes 

Source
Expand description

Entry routes that source code defines, for the coverage inventory upload.

Two route sources need the source text, not only the file path:

  • An Elysia app defines its routes with calls such as app.get("/repos/:repo", handler). elysia_routes reads every file that imports elysia, joins the instance, group and mount prefixes, and gives each route the file of its handler.
  • A TanStack Router route file gives its route id in the argument of createFileRoute("/repo/$repo"). file_route_id reads that argument.

The extraction is syntactic. A route with a path or a prefix that is not a string literal stays out of the result.

Structs§

CodeRoute
One route that source code defines.

Functions§

elysia_routes
The Elysia routes of every file in graph that imports elysia.
file_route_id
The route id in the first createFileRoute, createLazyFileRoute or createServerFileRoute call of source, when that argument is a string literal.