Используя основы Cloud, я пишу код для синхронизации elsaticseach с запущенным CRUD пожарного хранилища, но произошла следующая ошибка.
Error: no handler found for uri [//**] and method [POST]
Код ниже
const functions = require('firebase-functions');
const elasticsearch = require('elasticsearch')
const elasticsearchconf = functions.config().elasticsearch
let client = new elasticsearch.Client({ host: elasticsearchconf.url, log: 'trace', httpAuth: `${elasticsearchconf.username}:${elasticsearchconf.password}` })
exports.createDoc = functions.firestore.document('something/{somethingId}').onCreate(async (snap, context) => {
const id = context.params.somethingId
let data = snap.data()
await client.index({
index: 'something',
type: 'something',
id: id,
body: data
}, function (err, resp, status) {
if (err) {
console.log(err)
}
console.log(resp)
})
})
Я думаю, чтоэта ошибка подразумевает, что POST не может быть использован, но я не знаю, как с этим справиться.
Пожалуйста, дайте мне вашу мудрость.
Спасибо.