Deeplx-vercel
Deeplx-vercel copied to clipboard
Vercel Error
When I Tried This Api on localhost, koyeb and render it worked but when tried in vercel it showing this error
Error: 500 Response: {"code":500,"message":"Ошибка перевода","error":"Ошибка от сервера DeepL: 429 - { "code": 429, "message": "Too many requests. Please slow down and try again later." }\n"}
When I Tried This Api on localhost, koyeb and render it worked but when tried in vercel it showing this error
Error: 500 Response: {"code":500,"message":"Ошибка перевода","error":"Ошибка от сервера DeepL: 429 - { "code": 429, "message": "Too many requests. Please slow down and try again later." }\n"}
Most likely the query method is outdated. I'll do an update tomorrow
Another Thing I Added localhost support on this repo. We dont need to use the other repo you mentiond in repo
// server.js const express = require('express'); const app = express(); const PORT = 3000;
// Middleware app.use(express.json()); app.use((req, res, next) => { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS'); res.header('Access-Control-Allow-Headers', 'Content-Type'); next(); });
// Routes app.get('/', (req, res) => { res.json({ code: 200, message: "Welcome to DeepL Free API. POST to /api/translate." }); });
// Import translate endpoint (FIXED PATH) const translateHandler = require('./api/translate'); app.post('/api/translate', translateHandler);
// Start server
app.listen(PORT, () => {
console.log(Server running on http://localhost:${PORT});
});
bro add this on root then just run : node server.js
then just run : node server.js
Added
But what about the 429 error... I think the problem is in the vercel itself. Because deepl started to detect requests from vercel. I have no idea how to solve this yet. The catch is that on my PC and IP it pulls at least 100 requests per minute, but on vercel it falls after 5.