Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@colucom/osseus-moleculerweb

Package Overview
Dependencies
Maintainers
6
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@colucom/osseus-moleculerweb

Osseus moleculer-web(API Gateway) service module.

  • 2.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

JavaScript Style Guide

Osseus moleculer-web

Install

$ npm install @colucom/osseus-moleculerweb

Usage

This module creates new moleculer-web service: apiGateway, as each moleculer service , actions, methods , hooks & events can be added. The routes & started event function are mandatory for the operation of the service. see details below

const OsseusMoleculerWeb = require('@colucom/osseus-moleculerweb')
const moleculer = await OsseusMoleculerWeb.init(osseus)
const broker = moleculer.broker //Moleculer Service Broker Instance
const apiGatewayService = moleculer.service // Moleucler-Web ApiGateway Service

Configuration

Mandatory:

To make the moleculer-web Api Gateway module to function there must be configurations added.

  • OSSEUS_MOLECULER_WEB_ROUTES_PATH: 'Custom Path'

    The moleculer-web scheme need to recieve an array of route functions , according to the moleculer-web documentation.

    • the path to your routes functions array in the original project that requires the osseus-moleculerweb module.
    • default is ./broker/routes.
  • OSSEUS_MOLECULER_WEB_STARTED_EVENT_HANDLER_PATH: 'Custom Path'
    • the path to the event handler for the broker lifecycle 'started' event.
    • default is ./broker/events.
Optional:
  • OSSEUS_MOLECULER_WEB_MIDDLEWARES_PATH

    • If you wishing to use the middelware like functions in the Api Gateway module , you shoud provide path to the array of those functions in the original project that requires the osseus-moleculerweb module.
  • OSSEUS_MOLECULERWEB_ACTIONS_PATH

    • if you wish to add moleculer actions to the service , first you need to add the configuration to turn it on: OSSEUS_MOLECULERWEB_SHOULD_LOAD_ACTIONS: true,, and then add the whising path to the actions object.
  • OSSEUS_MOLECULERWEB_HOOKS_PATH

    • if you wish to add moleculer actions to the service , first you need to add the configuration to turn it on: OSSEUS_MOLECULERWEB_SHOULD_LOAD_HOOKS: true,, and then add the whising path to the actions object.
  • OSSEUS_MOLECULERWEB_METHODS_PATH

    • if you wish to add moleculer actions to the service , first you need to add the configuration to turn it on: OSSEUS_MOLECULERWEB_SHOULD_LOAD_METHODS: true,, and then add the whising path to the actions object.
  • OSSEUS_MOLECULERWEB_EVENTS_PATH

    • if you wish to add moleculer actions to the service , first you need to add the configuration to turn it on: OSSEUS_MOLECULERWEB_SHOULD_LOAD_EVENTS: true,, and then add the whising path to the actions object.

Contributing

Please see contributing guidelines.

License

Code released under the MIT License. `

FAQs

Package last updated on 14 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc