"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_fetch_1 = __importDefault(require("node-fetch"));
async function callGetWeather(city) {
const payload = {
jsonrpc: '2.0',
method: 'getWeather',
params: { city },
id: 1
};
const r = await (0, node_fetch_1.default)('http://localhost:3000/json-rpc', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
});
const data = await r.json();
console.log('Response:', JSON.stringify(data, null, 2));
}
callGetWeather('Mumbai').catch(console.error);