Cloudflare Workers を使用した API ツールのデプロイ
始めに
git clone https://github.com/crazywoola/dify-extension-workers.git
cp wrangler.toml.example wrangler.tomlname = "dify-extension-example"
compatibility_date = "2023-01-01"
[vars]
TOKEN = "bananaiscool"// ⬇️ ここにロジックを実装 ⬇️
// point === "app.external_data_tool.query"
// https://api.breakingbadquotes.xyz/v1/quotes
const count = params?.inputs?.count ?? 1;
const url = `https://api.breakingbadquotes.xyz/v1/quotes/${count}`;
const result = await fetch(url).then(res => res.text())
// ⬆️ ここにロジックを実装 ⬆️

その他のロジック TL;DR
Bearer 認証について
パラメータの検証について
Cloudflare ワーカーのログを取得する
参考内容
Last updated