我在致电第二次提供商时遇到此错误。
1)server.js(已使用:NodeJS)
const ds = deepstream('<URL>');
const randomURL = Math.ceil(Math.random() * 10000).toString();
ds.rpc.provide(randomURL, (data, response) => {
console.log("received request for: ", randomURL, data);
response.send(`${Date.now()} Hello from random Service: ${randomURL}`);
})
2)client.js(已使用:microjs)
module.exports = async (req, res) => {
let fullPath = req.url;
fullPath = fullPath.split('/')[1];
const result = await ds.rpc.make(fullPath, {}, (err, result) => {
console.log("response received: ", err, result);
res.end(result);
});
console.log(`result for ${fullPath} is: ${result}`);
}
第二次校准此网址后,我报错
localhost:port/randomURL