apache-dubbo-web v0.0.10
apache-dubbo-web
Dubbo is a family of libraries for building and consuming APIs on different languages and platforms. apache-dubbo brings type-safe APIs with Protobuf to TypeScript.
apache-dubbo-web
provides the following adapters for web browsers, and any other platform that has
the fetch API on board:
createDubboTransport()
Lets your clients running in the web browser talk to a server with the Dubbo protocol:
import { createPromiseClient } from "apache-dubbo";
+ import { createDubboTransport } from "apache-dubbo-web";
import { ElizaService } from "./gen/eliza_dubbo.js";
+ // A transport for clients using the Dubbo protocol with fetch()
+ const transport = createDubboTransport({
+ baseUrl: "https://demo.connect.build",
+ });
const client = createPromiseClient(ElizaService, transport);
const { sentence } = await client.say({ sentence: "I feel happy." });
console.log(sentence) // you said: I feel happy.
createGrpcWebTransport()
Lets your clients running in the web browser talk to a server with the gRPC-web protocol:
import { createPromiseClient } from "apache-dubbo";
+ import { createGrpcWebTransport } from "apache-dubbo-web";
import { ElizaService } from "./gen/eliza_dubbo.js";
+ // A transport for clients using the Dubbo protocol with fetch()
+ const transport = createGrpcWebTransport({
+ baseUrl: "https://demo.connect.build",
+ });
const client = createPromiseClient(ElizaService, transport);
const { sentence } = await client.say({ sentence: "I feel happy." });
console.log(sentence) // you said: I feel happy.
Getting started
To get started with Dubbo, head over to the docs for a tutorial, or take a look at our example.
Dubbo plays nice with Vue, Svelte, Remix, Next.js, Angular and many others. Take a look at our examples for various frameworks.
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago