FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
Koti_123

Koti_123

translator

Public
Like
1
translator
Home
Code
3
backend
2
shared
2
README.md
Branches
1
Pull requests
Remixes
1
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
backend
/
README.md
Code
/
backend
/
README.md
Search
5/23/2025
Viewing readonly version of main branch: v5
View latest version
README.md

Backend

The backend server built with Hono framework providing translation API endpoints.

Endpoints

GET /

Serves the main application HTML page.

GET /api/languages

Returns a list of supported languages for translation.

Response:

{ "languages": [ { "code": "en", "name": "English" }, { "code": "es", "name": "Spanish" }, ... ] }

POST /api/translate

Translates text between languages.

Request:

{ "text": "Hello world", "from": "en", "to": "es" }

Response:

{ "translatedText": "Hola mundo", "detectedLanguage": "en" }

Translation Service

Uses Google Translate's free API endpoint for translations. Supports:

  • Auto-detection of source language
  • Translation between 20+ common languages
  • Error handling for failed translations

Static File Serving

  • Serves frontend files from /frontend/*
  • Serves shared files from /shared/*
  • Uses Val Town's utility functions for proper file serving
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.