Library imported from TypeScript code generated from skir files.
Install with:
npm i @php-skir/skir-clientThe default SkirRPC transport stays compatible with upstream Skir. To exchange CBOR request and response bodies, opt in on both the client and service:
constclient=newServiceClient("https://example.com/rpc",undefined,{transportCodec: "cbor",});constservice=newService({transportCodec: "cbor"});CBOR transport sends a { method, request } envelope as application/cbor and
encodes the response value as application/cbor.
When installing a CBOR-enabled service on Express, pass Express's raw
middleware as the sixth argument:
installServiceOnExpressApp(app,"/rpc",service,text,json,raw);See:
- skir: home of the skir compiler
- skir-typescript-gen: skir to TypeScript code generator
- skir-typescript-example: example showing how to use skir's TypeScript code generator in a project