This application is a REST service based on Spring Boot that allows to translate text by using Yandex translator API.
Default Jdk version 1.8
Enter the following command in terminal from the project folder:
- Linux:
./gradlew build
- Windows:
gradlew.bat
- Linux:
./gradlew bootRun
- Windows:
gradlew bootRun
Input parameters: text = "Alf, hide in the kitchen", initial language = English, required language = Deutsch
- Linux:
curl -d '{"text" : "Alf, hide in the kitchen","from" : "en","to" : "de"}' -H "Content-Type: application/json" -X POST http://localhost:8080/translate
- Windows:
curl -d "{\"text\" : \"Alf, hide in the kitchen\",\"from\" : \"en\",\"to\" : \"de\"}" -H "Content-Type: application/json" -X POST http://localhost:8080/translate
Application response: Alf, ausblenden in die Küche
All requests are stored in the in-memory H2 database. When the application is running, you can see all requests in H2 console:
-
Type http://localhost:8080/h2-console in browser address bar
-
Set required parameters like here and connect to the database:
-
Type
SELECT * FROM REQUEST
query in the database console to see all service requests: