0.1.6 • Published 2 months ago

aurora-rpc-server v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

AuroraRPC-Server

Description

This is the server implementation for Aurora RPC.
The server is based on the websocket protocol. It uses the ws library.
The client implementation is available in AuroraRPC-Client.

Installation

npm i aurora-rpc-server

Usage

import { Server } from 'aurora-rpc-server';

const debug = false; // Set to true to enable debug output

const server = new Server({
    // websocket server options
    port: 8080,
}, debug);

// --- Create a request handler ---

import { AbstractRequest, ResponseResult } from 'aurora-rpc-server';

class HelloRequest extends AbstractRequest {
    method = "hello"

    invoke(): ResponseResult {
        return "Hello Aurora RPC!";
    }
}

// --- Register request handlers ---

server.registerRequest(new HelloRequest());
0.1.6

2 months ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago