This is a very simple implementation of papago proxy server, using headless Chrome.
Sometimes you just want to test with Papago API without signing up for Naver Developers API... This is just for that. This means that you do not need a secret key.
👉 https://papago-proxy.vercel.app/api/translate?text=hello%20from%20papago%20proxy
(the free plan on Vercel is slow, might need to wait for about 6~7 secs)
GET /translate?text={text}&wait_for_msec={msec}
querystrings:
text
: required. text to be translatedwait_for_msec
: optional. custom option to wait on headless Chrome until translate is fully done. This can be set if the text is too long to be translated in a short time. This is to be removed later.
Check out https://logflare.app/sources/public/H-kRJ2IfiYbDKsnk
Request:
GET https://papago-proxy.vercel.app/api/translate?text=hello
Response:
{
"text": "안녕하십니까"
}
- The free plan on vercel serverless functions only supports running up to 10 secs. It won't allow long sentences to be succesfully translated. The free plan runs quite slowly too, due to memory limitations.
- As far as I know, this must not be used for commercial purposes. Sign up for Naver developers API and use that if you want some commercial purpose.
src/server/server.ts
is for using cluster on non-serverless environments. I doubt if it is worth using it.
- More language options
- Deploy to AWS lambda or Azure for a better example