class

Analyzer::Javascript::Moleculer

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

Moleculer services reach HTTP only through a moleculer-web gateway (mixins: [ApiGateway]), whose settings.routes[] map URLs to actions:

aliases: { "GET users/:id": "users.get" } → GET /<route.path>/users/:id aliases: { "health": "api.health" } → ANY aliases: { "REST posts": "posts" } → the six CRUD routes autoAliases: true → every action's rest:

Alias targets are resolved against the services' actions so the action's params validator names the request params.

Constants

GATEWAY_IMPORT = /(?:\bfrom\s*|\brequire\s*\(\s*)['"]moleculer-web['"]/
PACKAGE_MARKERS = ["\"moleculer\":", "\"moleculer-web\":"]
REST_ROUTES = [{"GET", "", "list"}, {"GET", "/:id", "get"}, {"POST", "", "create"}, {"PUT", "/:id", "update"}, {"PATCH", "/:id", "patch"}, {"DELETE", "/:id", "remove"}]

moleculer-web's REST alias shorthand.

SERVICE_HINT = /\b(?:actions|routes)\s*:/

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

Nested types