Skip to content

Instantly share code, notes, and snippets.

@icebob
Last active March 23, 2019 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebob/ce03509457816f8d36877ded39f79266 to your computer and use it in GitHub Desktop.
Save icebob/ce03509457816f8d36877ded39f79266 to your computer and use it in GitHub Desktop.
Example API service with products REST aliases
"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