UNPKG

json-crdt-server

Version:

JSON CRDT server and syncing local-first browser client

19 lines (18 loc) 755 B
"use strict"; // Run: npx ts-node src/main.ts // curl localhost:9999/rpc -H 'Content-Type: rpc.rx.compact.json' -d '[1,1,"util.ping"]' Object.defineProperty(exports, "__esModule", { value: true }); const routes_1 = require("./routes"); const RpcServer_1 = require("@jsonjoy.com/reactive-rpc/lib/server/http1/RpcServer"); const main = async () => { const services = await (0, routes_1.createServices)(); const server = await RpcServer_1.RpcServer.startWithDefaults({ port: +(process.env.PORT || 9999), caller: (0, routes_1.createCaller)(services).caller, logger: console, }); // tslint:disable-next-line:no-console console.log(server + ''); }; // tslint:disable-next-line no-console main().catch(console.error);