Simplicity is the ultimate sophistication. - Leonardo da Vinci
This is designed to use API-based Extension in Dify.
It includes the following features to make sure your application is secure and reliable.
- Bearer token authentication
- Schema validation
- Deploy to Cloudflare Workers
- Hono - Fast, Lightweight, Web-standards, Runs on any JavaScript runtime.
- Zod - TypeScript-first schema validation with static type inference.
You can run the following commands to start the development server.
Open this page in browser http://localhost:8787 to see the result. If you would like to have swagger ui to test the API, please follow this instruction.
npm install
npm run dev
You should be able to access the workers.dev domain after deploying to Cloudflare Workers.
npm run deploy
name: <your-extension-name>
api_endpoint: https://<your-subdomain>.workers.dev/endpoint
api_key: <your-token> <this is set in the wrangler.toml>
This is an example of sending a check request to the endpoint.
{
"point": "ping",
}
This is an example of sending a query request to the endpoint.
{
"point": "app.external_data_tool.query",
"params": {
"app_id": "61248ab4-1125-45be-ae32-0ce91334d021",
"tool_variable": "breaking_bad_quotes",
"inputs": {
"count": 5
},
"query": "Display the quotes in markdown quote"
}
}