RPC Docs.

Prim+RPC is prerelease software. It may be unstable and functionality may change prior to full release.

Examples

I've created a few projects to demonstrate various ways that Prim+RPC could be used. It's not an exhaustive list and the examples are intended to be very simple but they should provide a great reference or even as a starting point for working with Prim+RPC.

See the README.md files in each linked example for an overview. Each example is commented thoroughly to explain each step. If you only need to see examples of how to use certain features of Prim+RPC, you may also read the Usage guide.

Simple Test

Open in StackBlitz

This example demonstrates the simplest usage of Prim+RPC: in a single file as it may be used in a testing environment.

You can download this example with the command below or download Simple Test directly.


npx giget@latest gh:doseofted/prim-rpc-examples/simple-test prim-rpc-examples/simple-test

Server/Client Interaction

Open in StackBlitz

This example demonstrates communication between a web server and website in the same project with Prim+RPC.

You can download this example with the command below or download Server/Client Interaction directly.


npx giget@latest gh:doseofted/prim-rpc-examples/client-server prim-rpc-examples/client-server

Serverless

Open in StackBlitz

This example demonstrates communication between a serverless function and website in the same project with Prim+RPC.

You can download this example with the command below or download Serverless directly.


npx giget@latest gh:doseofted/prim-rpc-examples/serverless prim-rpc-examples/serverless

Web Worker Communication

Open in StackBlitz

This example demonstrates communication between a website and its Web Worker.

You can download this example with the command below or download Web Worker Communication directly.


npx giget@latest gh:doseofted/prim-rpc-examples/web-worker prim-rpc-examples/web-worker

Monorepo Setup

Open in StackBlitz

This example demonstrates a monolithic repository where a separate JavaScript module is imported by a web server using Prim+RPC.

You can download this example with the command below or download Monorepo Setup directly.


npx giget@latest gh:doseofted/prim-rpc-examples/monorepo-setup prim-rpc-examples/monorepo-setup

Custom JSON Handler

Open in StackBlitz

This example demonstrates a Prim+RPC project where the JSON handler is replaced with an alternative handler.

You can download this example with the command below or download Custom JSON Handler directly.


npx giget@latest gh:doseofted/prim-rpc-examples/custom-handler prim-rpc-examples/custom-handler

Server Context

Open in StackBlitz

This example demonstrates a web server that shares its request context with Prim+RPC.

You can download this example with the command below or download Server Context directly.


npx giget@latest gh:doseofted/prim-rpc-examples/server-context prim-rpc-examples/server-context

Fullstack Framework

Open in StackBlitz

This example demonstrates Prim+RPC when used in a fullstack framework.

You can download this example with the command below or download Fullstack Framework directly.


npx giget@latest gh:doseofted/prim-rpc-examples/fullstack-framework prim-rpc-examples/fullstack-framework

Prim+RPC: a project by Ted Klingenberg

Dose of Ted

Anonymous analytics collected with Ackee