RPC Node JS RPC action users method Query Slides: 16 Download presentation RPC в Node. JS [ ] Пример RPC запроса { } “action”: “users”, “method”: “Query”, “data”: [{ “filter”: [{ “property”: “login”, “value”: “user” }] }], “type”: “rpc”, “tid”: 1 Документация: https: //www. appcode. pw/? page_id=463 RPC «сущность» в Node. JS exports. [имя сущности] = function(session) { return { is. Local: true, /// !!! } 06 }; [имя сущности]: function(data, callback) { callback([результат]); } Регистрация созданной сущности в RPC var shell = require('postgresql-rpc-shell'); var shell. Object = { db: db, namespace: ns, contexts: [ require('. /modules/webapi'), require('. /modules/adminapi') ], … }; 08 app. use(shell. Object)); Взаимодействие с БД Запуск node bin/www Подключение к БД и генерация схемы … var render = require('dynamic-schema-reader'); // модуль генерации шаблонов module. exports = function (callback) { reader({ … connection. String: connection. String auto. Remove: true, schema. List: ["'core'", "'public'", . . . ] }, function (schemas) { var content = ejs. compile(…); fs. write. File. Sync(path, content); … }); } Генерация dbcontext. js Пример dbcontext. js Reference node and non reference nodeReference node and non reference nodeWavelength constructive interferenceNodenextHamiltonian operatorStruct node int data struct node* nextDns recursive iterativeQuery tree and query graphQuery tree and query graphNode voltageTechniques of symposiumAsynchronous rpcRpc e rmiRpc message formatRpc plumbingRpc semantics in the presence of failuresRpc computer science