serverless-thrift

trhift rpc server using aws-lambda

Usage no npm install needed!

<script type="module">
  import serverlessThrift from 'https://cdn.skypack.dev/serverless-thrift';
</script>

README

Thrift serverless library for Node.js

Build Status npm version semantic-release

This package provides an implementation of a Thrift client and server over serverless functions for Node.js

Installation

From your project directory:

npm install --save serverless-thrift

Getting started (AWS Lambda)

Simply use the createLambdaServer function to wrap your Thrift handler:

const serverlessThrift = require("serverless-thrift")
const Calculator = require("./gen-nodejs/Calculator");
Const handler = require("./calculator_handler.js");

const server = serverlessThrift.createLambdaServer(Calculator, handler);
module.exports.handle = server.handle.bind(server);

A full example is located under the example directory