JavaScript web app that does text-to-speech and language translation using the Web Speech API, Google Translate and Vercel serverless functions.
Create your Google API key and create a .env file and add the following:
GOOGLE_TRANSLATE_API_KEY=YOUR_KEY
Install Dependencies:
npm installRun The Vercel CLI
vercel devOpen http://localhost:3000 in your browser
The serverless function is located in the /api/translate.js file and can be accessed with the endpoint /api/translate
