A smart API which not only translates the text given by the user in desired langaugae but also caches the previous results to reduce the response time .
If you dont have Redis installed ,install it with this link . After that it would be ready to use on your localhost:3000
npm install
node index.js
Caching :
A user enters the text to be translated . It get stored in cache . So next time if the desired result is found in cache the api does not get hit .
Smart Pre Caching :
Suppose a User demands a text to be translated in Hindi . Web Server automatically stores the result in Urdu , Marathi , Gujrati , Punjabi .
Thus saving the response time for the User. (Refer Map.js)
Step 1 : Install redis and deploy on localhost
Step 2 : Go to Postman
Set Url : "http://localhost:3000/translate"
Go to Body , Select xxx-www-form-urlencoded
Step 3 :
GET /translate| Parameter | Type | Description |
|---|---|---|
text |
string |
Required. Text to be Translated |
| Parameter | Type | Description |
|---|---|---|
toTranslate |
string |
Required. Language in which it needs to be translated |
Takes two params and returns the Translated Word.