Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const ApiGateway = require("moleculer-web");
- module.exports = {
- name: "api",
- mixins: [ApiGateway],
- settings: {
- port: process.env.PORT || 3000,
- routes: [{
- path: "/rest",
- // RESTful aliases
- aliases: {
- "GET articles": "articles.list",
- "GET articles/:id": "articles.get",
- "POST articles": "articles.create",
- "PUT articles/:id": "articles.update",
- "DELETE articles/:id": "articles.remove"
- },
- // Disable direct URLs (`/articles/list` or `/articles.list`)
- mappingPolicy: "restrict",
- whitelist: [
- // Access any actions in 'articles' service
- "articles.*"
- ]
- }]
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement