978 B
978 B
DeepLite BFF Server
Backend-for-Frontend proxy server for the DeepLite PWA.
Configuration
Create a .env file:
DEEPL_AUTH_KEY=your-deepl-api-key
BEARER_TOKEN=your-secure-token
PORT=8000
API Endpoints
POST /translate
Translates text using the DeepL API.
curl -X POST http://localhost:8000/translate \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text": "Hello world!", "target_lang": "FR"}'
Parameters:
text(required): Text to translatetarget_lang(required): Target language code (e.g., "FR", "DE", "ES")source_lang(optional): Source language code (auto-detected if not provided)
GET /languages
Retrieves the list of supported languages.
curl http://localhost:8000/languages \
-H "Authorization: Bearer YOUR_BEARER_TOKEN"
GET /health
Health check endpoint (no authentication required).
curl http://localhost:8000/health