A progressive Node.js framework for building efficient and scalable server-side applications.
Description
Translation API using AWS Translate api.
Installation
Make .env
file from .env.example
.
$ cp .env.example .env
Fill in AWS access key, secret and region.
$ npm install
Running the app
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
The development API server will be hosted on http://127.0.0.1:3000.
Use curl to test the API.
$ curl -H "Content-Type: application/json" -d '{"text": "bonjour!"}' -X POST http://127.0.0.1:3000/translate
API Documentation
Method: POST
Url: /translate
Payload:
{
"text": "<text to translate>",
"sourceLangCode": "<language code>", // default "auto"
"targetLangCode": "<lagnuage code>" // default "en"
}
To get more information about the language codes, please check this AWS documentation.
License
Nest is MIT licensed.