class

Analyzer::Javascript::Medusa

Inherits Analyzer::Javascript::JavascriptEngine < Analyzer < FileHelper < Reference < Object

Medusa v2 custom APIs are file routes under src/api, one exported function per verb (export const GET), the same shape as a Next.js App Router route.ts with src/api in place of app.

src/api/store/hello/[id]/route.ts -> GET /store/hello/{id} src/api/admin/custom/route.ts -> POST /admin/custom

[id] becomes {id} via JavascriptEngine#file_route_url. Only route.ts is a route. Guards live in middlewares.ts, not here.

Constants

API_ROOT = "/src/api/"
PACKAGE_MARKERS = ["\"@medusajs/medusa\"", "\"@medusajs/framework\""]

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source