Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. const ApiGateway = require("moleculer-web");
  2.  
  3. module.exports = {
  4. name: "api",
  5. mixins: [ApiGateway],
  6.  
  7. settings: {
  8. port: process.env.PORT || 3000,
  9.  
  10. routes: [{
  11. path: "/rest",
  12.  
  13. // RESTful aliases
  14. aliases: {
  15. "GET articles": "articles.list",
  16. "GET articles/:id": "articles.get",
  17. "POST articles": "articles.create",
  18. "PUT articles/:id": "articles.update",
  19. "DELETE articles/:id": "articles.remove"
  20. },
  21.  
  22. // Disable direct URLs (`/articles/list` or `/articles.list`)
  23. mappingPolicy: "restrict",
  24.  
  25. whitelist: [
  26. // Access any actions in 'articles' service
  27. "articles.*"
  28. ]
  29. }]
  30. }
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement