New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

micro-handler

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-handler

Module for quick start with microservice structure.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
-20%
Maintainers
1
Weekly downloads
 
Created
Source

Mircoservice handler

Module for quick start with microservice structure.

  • loads all installed microsservices
  • exposes REST methods
  • easy to configure

Installation

$ npm install micro-handler --save

Usage

Just require handler and pass directory of microservices.

const MH = require('micro-handler')('microservices/');

When calling REST methods, micro-handler will return promise.

To use REST interface from all loaded microservices, call its "folder-name":

MH.{nameOfMicroservice}.{method}('{route}', {someParams: optionally}, {override: optionally});

For example... Calling POST method on mail microservice to send email with some title:

MH.mail.post('/send', {title: 'some title'});

Port is automatically parsed from microservice configuration, but you can override any params using ovveride object like:

MH.mail.post('/send', {title: 'some title'}, {port: 1337});

Todos

  • Remove GOT dependency, use native HTTP

FAQs

Package last updated on 31 Oct 2016

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