Skip to content

Instantly share code, notes, and snippets.

@rzvdaniel
Created July 6, 2019 17:25
Show Gist options
  • Save rzvdaniel/0537e918420b78431cc8ce6e04cabb77 to your computer and use it in GitHub Desktop.
Save rzvdaniel/0537e918420b78431cc8ce6e04cabb77 to your computer and use it in GitHub Desktop.
[Medium] Moleculer Routing - Auto Aliases
const ApiGateway = require("moleculer-web");
module.exports = {
name: "api",
mixins: [ApiGateway],
settings: {
port: process.env.PORT || 3000,
routes: [{
// Access 'users' service through the /autoalias route
path: "/autoalias",
// Auto generate aliases
autoAliases: true,
whitelist: [
// Access any actions in 'users' service
"users.*"
]
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment