Skip to content

moleculerjs/sandbox-moleculer-api-routing

Repository files navigation

Moleculer Routing Examples

Routing examples from Moleculer Web Examples repository:

https://github.com/moleculerjs/moleculer-web/tree/master/examples

Default Route Settings

Access to all services through the '/simple' route.

Uses API Gateway service with default settings.

Access greeter.*, math.* & internal $node.* actions.

Examples:

Official Documentation: https://moleculer.services/docs/0.13/moleculer-web.html#Aliases

Auto-aliases generator

Access to all services through the '/autoalias' route.

Uses API Gateway service auto-aliases generator feature

You don't need to create aliases for your actions.

It collects & read from action definitions & build aliases.

Examples:

Official Documentation: https://moleculer.services/docs/0.13/moleculer-web.html#Aliases

REST aliases

This route uses API Gateway as a RESTful API server

Access 'articles' service through the '/rest' route.

Examples:

Shorthand RESTful aliases

Shorthand RESTful aliases

Access 'articles' service through the '/shortrest' route.

Disable direct URLs (`/articles/list` or `/articles.list`)

Examples:

Official Documentation: https://moleculer.services/docs/0.13/moleculer-web.html#Aliases

Route Whitelisting

Access to all services through the '/whitelist' route.

Provides access to certain services & actions

Services and actions outside the whitelist are not accessible.

Examples:

Official Documentation: https://moleculer.services/docs/0.13/moleculer-web.html#Whitelist