From 9449745a0b9d09f579fad76e140ab2311a218b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E6=98=8E?= Date: Mon, 13 Nov 2023 23:49:15 +0800 Subject: [PATCH] doc: fix known issues --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 1210140..24e3df9 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,23 @@ yarn run lint --fix Based on current testing, Cloudflare and Cloudflare-based edge function runtimes (Vercel) are not able to correctly request the DeepL server, and a 525 error occurs, a detailed description of the issue can be found [here](https://github.com/cloudflare/workerd/issues/776). +For this case, it can be solved using the [DeepL proxy server](https://github.com/ifyour/deepl-proxy), refer to Deploying to Cloudflare Code: + +```ts +import { Hono } from 'hono' +import { query } from '@ifyour/deeplx' + +const app = new Hono() + +app.post('/translate', async c => { + const params = await c.req.json() + const result = await query(params, { proxyEndpoint: 'https://ideepl.vercel.app/jsonrpc' }) + return c.json(result, result.code) + }) + +export default app +``` + ## License DeepLx is available under the MIT license.