Giter Club home page Giter Club logo

node-translation-api's Introduction

Translation API with NodeJS

Objective of the Project:

  • To create a web server with a RESTful API to translate a text from one language to another, using Google Cloud Translation API
  • To cache translations, in order to avoid repeated hits to the API
  • To implement smart pre-caching

How to Use and Test this Server ?

  1. Clone this repository into your local device.
  2. Go to the project directory and run npm install command from your terminal.
  3. Run export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/node-translation-api-6b2091d0fe30.json" command after giving it the proper file path to the node-translation-api-6b2091d0fe30.json file, which will be provided to you separately via e-mail.
  4. Start the server with node server.js command.
  5. Listen to localhost:5000 port to check whether the server is properly running or not.
  6. Submit POST request to the localhost:5000/translate endpoint. The request must contain a text field and a target field in its body in x-www-form-urlencoded format. The Google Cloud Translation API behind the scenes is smart enough to detect the source language. You must mention ISO-639-1 Code of the 'target' language (Reference: https://cloud.google.com/translate/docs/languages) to specificy the language into which you want to translate your text.

node-translation-api's People

Contributors

basuabhirup avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.