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

grpc-server-ts

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-server-ts

a grpc server side module built by typescrpt

  • 1.1.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
17
increased by466.67%
Maintainers
1
Weekly downloads
 
Created
Source

NPM version

Installation

npm install grpc-server-ts --save

protobuf

hello.proto

syntax = "proto3";

option java_multiple_files = true;
option java_package = "io.grpc.service.test";
option objc_class_prefix ="RTG";

package hello;

service Hello {
  rpc say(stream Empty) returns (stream Word) {};
}

message Empty {

}

message Word {
  string word = 1;
}

define a service

import { Route, Service } from "grpc-server-ts";

@Service('path_to_hello.proto')
export class HelloService {
  @Route
  public async say() {
    return 'hello world';
  }
}

registry service grpc

import { RpcRegistry, Settings } from 'grpc-server-ts';

@Settings(settings)
class RPC extends RpcRegistry { }
RPC.start();

settings

{
  port: "3333",                     // listen port
  host: "localhost",                // listen host
  ca: "runtime/rpc/ca.crt",         // ca file path
  cert: "runtime/rpc/server.crt",   // cert file path
  key: "runtime/rpc/server.key"     // key file path
}

Keywords

FAQs

Package last updated on 14 May 2019

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