Giter Club home page Giter Club logo

deeplx-serverless's Introduction

DeepLX Serverless

DeepLX 免费翻译API函数部署版,与原项目DeepLX的区别在于利用了无服务器函数(也叫边缘函数)的请求IP不固定的特性,极大程度上避免了429请求太频繁报错

如果本项目对你有用的话,不妨点个Star❤️
Click Star if you like!! thanks❤️

Major Changes | 重大改变

*vvvvery big changes🤣

如果您在这之前不使用本项目,此部分可以跳过。

  1. 新增了docker部署支持
  2. 请求参数变化: alternative_number -> alt_count

Let's Go | 开始使用

Prerequisites | 你需要准备什么

  • 一双灵活的小手
  • 一个聪明的脑袋瓜
  • 支持 Nodejs ≥16.13Serverless Function 的服务器

Deploy | 部署

使用任意支持无服务器函数部署的服务器,比如可以使用 Vercel 或者 Netlify 进行部署,又或者其他能够使用nodejs的服务器。(大多数服务器提供商都提供函数计算服务器)

如果你拥有Vercel账号的话那就很简单了,因为你只需要点击下方按钮即可一键部署到Vercel:

Deploy with Vercel

因维护者我有多个仓库需要维护,短时间内将无法对多平台部署方案进行兼容,您可以选择自托管方案。
✨项目当前没有任何需要填写的变量值,你只需要直接部署就可以用了,但在后续可能会添加。

如果部署完成了,就可以开始使用啦!🎉

Docker

直接运行容器:

docker run -d -p 9000:9000 deeplx-api

你还可以自己构建后运行:

docker build -t deeplx-api .
docker run -d -p 9000:9000 deeplx-api

Self hosting | 自托管

✅尽管本项目是专为 serverless 适配的方案,但是也能使用自己的服务器进行部署:

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

📋直接复制到命令行运行:

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

🚧你可以运行npm run test用来测试翻译接口。
⚠️注意!测试命令仅返回翻译内容,获取所有结果需要使用POST

How To Use | 如何使用

使用post通过 域名地址 + /translate + json请求体 这样的形式获取json响应。

详细API文档,请查看本项目的wiki:
English | 简体中文

📋你可以直接复制到命令行运行本地测试:

curl --location --request POST 'http://localhost:9000/translate' --header 'Content-Type: application/json' --data '{"text": "你好,世界!", "source_lang": "zh", "target_lang": "en"}'

✨部署完成后,建议搭配浏览器插件「沉浸式翻译」一同使用。

沉浸式翻译设置

  1. 在浏览器上安装最新的 沉浸式翻译
  2. 点击左下角的 "开发者设置"。启用测试版实验功能。
  3. 翻译服务选中 DeepLX(beta)
  4. 设置 URL 为刚才获取的访问路径(需带translate)。

沉浸式翻译

Contribute | 贡献

Important

在您做出贡献之前,请先切换到dev分支!! 因为解决分支冲突真的很麻烦!

本人因时间(和各种各样的)原因,故无法及时对您的贡献进行测试,所以您需要自行测试

Star History

Star History Chart

Acknowledgments | 鸣谢

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

deeplx-serverless's People

Contributors

guobao2333 avatar hkint avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.