如何解决Zappier 代码在使用套接字或 radis 的套接字上触发
我正在尝试编写一个可在任何新数据上运行的 zappier 触发器。我正在尝试使用套接字或 Redis 来完成此操作。在这个例子中,我将使用带 zappier-cli 的套接字。如果任何人的代码指向一个类似的例子,这将是一个很大的帮助,请帮助。
const listRecipes = (z,bundle) => {
// import SocketIOClient from 'socket.io-client';
const SocketIOClient = require('socket.io-client')
// z.console.log('hello from a console log!')
// const promise = z.request(
// 'http://57b20fb546b57d1100a3c405.mockapi.io/api/recipes'
// )
// return promise.then(response => response.json)
socket = SocketIOClient(SocketURL);
socket.on(`msg-channel/53`,(data) => {
// trigger when this achieved
});
}
module.exports = {
key: 'recipe',noun: 'Recipe',display: {
label: 'New Recipe',description: 'Trigger when a new recipe is added.'
},operation: {
perform: listRecipes,sample: {
id: 1,createdAt: 1472069465,name: 'Best Spagetti Ever',authorId: 1,directions: '1. Boil Noodles\n2.Serve with sauce',style: 'italian'
}
}
}
谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。