97久久精品无码一区二区天美,开裆裤羞辱调教高h绳子,欧美成人brazzers,成人免费午夜性大片,成人国产一区二区精品小说

Skip to content

guobao2333/DeepLX-Serverless

Repository files navigation

DeepLX Serverless

Repository

本項(xiàng)目3.0版本開(kāi)始完全基于OwO-Network/DeepLX和DeepL網(wǎng)頁(yè)端API進(jìn)行重寫(xiě)。
2.0及之前版本在LegendLeo/deeplx-serverless的基礎(chǔ)上進(jìn)行重構(gòu)。

DeepLX Serverless是一個(gè)基于DeepL翻譯且無(wú)需令牌的網(wǎng)頁(yè)API的Serverless版本,與原項(xiàng)目DeepLX的區(qū)別在于利用了無(wú)服務(wù)器函數(shù)(邊緣函數(shù))請(qǐng)求IP不固定的特性,有效避免了Error 429(不過(guò)嘛凡事總有例外ˉ\_(ツ)_/ˉ)

請(qǐng)勿濫用本項(xiàng)目!如果您有大量?jī)?nèi)容需要翻譯,請(qǐng)購(gòu)買(mǎi)DeepL的付費(fèi)服務(wù),項(xiàng)目使用的網(wǎng)頁(yè)版接口會(huì)受到DeepL政策限制。

Prerequisites | 準(zhǔn)備工作

Important

有時(shí)main分支的合并可能不及時(shí),或者你希望提前體驗(yàn)新功能,請(qǐng)切換到dev分支獲取代碼。

  • 支持 Nodejs ≥18DockerServerless Function 的服務(wù)器
  • (可選) 擁有Vercel的賬號(hào)

Deploy | 部署

Deploy with Vercel

git clone https://github.com/guobao2333/DeepLX-Serverless
cd DeepLX-Serverless
npm i
npm run start

配置可編輯.env或者提供啟動(dòng)參數(shù)來(lái)修改。

Docker | 容器部署

??預(yù)構(gòu)建:

docker run -d -p 6119:6119 ghcr.io/guobao2333/deeplx-serverless

自行構(gòu)建:

docker build -t deeplxs .
docker run -d -p 6119:6119 deeplxs

Startup Parameters | 啟動(dòng)參數(shù)

Important

此功能在 2.0.0 及以上版本中可用。 啟動(dòng)參數(shù)會(huì)覆蓋.env

有時(shí)你可能想在啟動(dòng)服務(wù)時(shí)添加參數(shù)。
比如添加一個(gè)-c參數(shù)來(lái)允許所有跨域請(qǐng)求:

npm run start -- -c

??使用-h來(lái)獲取所有參數(shù)。

How To Use | 如何使用

Http Call | 網(wǎng)絡(luò)請(qǐng)求

curl -X POST 'http://localhost:6119/translate' -H 'Content-Type: application/json' -d '{"text": "你好,世界!", "source_lang": "zh", "target_lang": "en"}'

Internal Call | 集成使用

運(yùn)行npm test來(lái)測(cè)試翻譯接口。還可以集成到你的項(xiàng)目中來(lái)使用DeepL翻譯服務(wù)。

簡(jiǎn)單的示例:

import { translate } from './src/translate.js';
translate('how are you?', 'en', 'zh', '', false, false)
.then(result => {
  console.log(result)
});

Star History | 收藏趨勢(shì)

Star History Chart

Contribute | 貢獻(xiàn)

  1. 獲取devmain分支的代碼
  2. 提交你的更改并描述提交內(nèi)容
  3. 打開(kāi)一個(gè)Pull Requests

如果你是第一次貢獻(xiàn),那么請(qǐng)查看《如何為開(kāi)源做貢獻(xiàn)》

Thanks | 感謝

它們是本項(xiàng)目的根本,沒(méi)有它們就沒(méi)有本項(xiàng)目。

  1. OwO-Network/DeepLX
  2. LegendLeo/deeplx-serverless
  3. bropines/Deeplx-vercel