UNPKG

rpc_ts

Version:

Remote Procedure Calls in TypeScript made simple

19 lines 696 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const moment = require("moment"); const common_1 = require("../common"); class TimestampServerContextConnector { async decodeRequestContext(_encodedRequestContext) { return {}; } async provideResponseContext() { // TODO: probably better to get the time from MySQL // (e.g. `SELECT UTC_TIMESTAMP() FROM DUAL;`). return { [common_1.ModuleRpcContextCommon.timestampContextKeys .serverTimestamp]: moment.utc().format(), }; } } exports.TimestampServerContextConnector = TimestampServerContextConnector; //# sourceMappingURL=timestamp.js.map