-
-
Save icebob/ce03509457816f8d36877ded39f79266 to your computer and use it in GitHub Desktop.
Example API service with products REST aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const ApiGateway = require("moleculer-web"); | |
module.exports = { | |
name: "api", | |
mixins: [ApiGateway], | |
// More info about settings: http://moleculer.services/docs/moleculer-web.html | |
settings: { | |
port: process.env.PORT || 3000, | |
routes: [{ | |
path: "/api", | |
whitelist: [ | |
// Access to any actions in all services | |
"*" | |
], | |
aliases: { | |
"REST products": "products" | |
} | |
}], | |
// Serve assets from "public" folder | |
assets: { | |
folder: "public" | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment