const client = new elasticsearch.Client({
host: [
{
host: '35.192.45.130//elasticsearch',
auth: 'user:password',
protocol: 'http',
port: 80
}
]
});
//
await client.ping({
// ping usually has a 3000ms timeout
requestTimeout: 1000
}, function (error) {
if (error) {
console.trace('elasticsearch cluster is down!');
} else {
console.log('All is well');
}
});我不能用离子授权给elasticsearch。但是有了邮递员,我已经可以登录并执行一些操作了。
错误是
对飞行前请求的响应不会通过访问控制检查:请求的资源上没有“访问-控制-允许-原产地”标题。因此,“http://localhost:8100/”源是不允许访问的。响应具有HTTP状态代码401。
https://stackoverflow.com/questions/52255459
复制相似问题