Socket
Book a DemoInstallSign in
Socket

@push-rpc/micro

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@push-rpc/micro

- Push-RPC for Websocket/HTML API - JSON-based config files - (Optional) Distributed logging - (Optional) MySQL connection - (Optional) Report common set of metrics to AWS CloudWatch - (Optional) Common "Ping" to check service availability. - (Optional) A

1.0.26
latest
npmnpm
Version published
Weekly downloads
26
Maintainers
1
Weekly downloads
 
Created
Source

Highly-opinionated framework for quick starting Microservices using Node.JS.

Supports

  • Push-RPC for Websocket/HTML API
  • JSON-based config files
  • (Optional) Distributed logging
  • (Optional) MySQL connection
  • (Optional) Report common set of metrics to AWS CloudWatch
  • (Optional) Common "Ping" to check service availability.
  • (Optional) Auto generate OpenAPI documentation

Use

yarn add micro-rpc

local-config.json

{
  "serverId": "hello1",
  "ports": {
    "http": 8092
  }
}

start.js

import {startMicroService} from "micro-rpc"

class HelloServiceImpl {
  async getHello() {
    return "hello"
  }
}

startMicroService({
  name: "helloService",
  services: {
    hello: new HelloServiceImpl(),
  },
})

To test it:

node ./start.js 

And then

curl -X POST http://localhost:8092/api/helloService/hello/getHello

FAQs

Package last updated on 27 Oct 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.