Testing
This guide explains the ways we can test the app from our local environment. This will help with solving the potential bugs or issues before deploying the app.
Prerequisites:
- Ngrok
- MongoDB
Ngrok
Ngrok exposes local servers to the public internet over secure tunnels. The app endpoints need to be public for Trados to find them.
You can find a quick guide on how to install and set up Ngrok here.
Usage
Find the port on which the app runs in the configuration files:
launchSettings.jsonfor the .NET blueprint{ ... "Rws.LC.AppBlueprint": { ... "applicationUrl": "http://localhost:5000" } }application.ymlfor the Java blueprint... server: port: 5000 ...
Open a Command-line tool (for example
cmd,PowerShell), navigate to your Ngrok location, and run this command for your port:ngrok http 5000
Configuration
After having started a new session, you can find the exposed URLs in the Command-line.
Copy the URL that uses https. For example:

Locate the
baseUrlsetting in the configuration files and replace it with the copied URL:appsettings.jsonfor the .NET blueprintapplication.ymlfor the Java blueprint
Testing
Although you could access the descriptor URL from a browser, we recommend using a testing client like Postman to perform the
GETrequest to your descriptor URL, namelyhttps://<ngrokURL>/<descriptorPath>. For example:GET https://47b6-78-96-152-25.ngrok.io/v1/descriptor
If you have problems accessing the URL, you can try running Ngrok using one of these alternative commands:
ngrok http 5000 -host-header="localhost:5000"ngrok http https://localhost:5000 -host-header="localhost:5000"Make sure the descriptor response contains the correct value for the
baseUrlfield.Register the app in Trados using the URL provided by Ngrok.
Note
You can restart the app application anytime while running a Ngrok session, without having to start a new session.
MongoDB
We recommend using MongoDB as it is free and fairly easy to use. For testing purposes, the community version should be enough.
The installation package should also include the MongoDB Compass Community application which is the user interface for your database. Here we can see the collections with the documents inserted by the app at runtime.
For example:

You can edit the Mongo settings in the configuration files of the blueprints:
appsettings.jsonfor the .NET blueprint{ ... "MongoDb": { "Connection": "mongodb://localhost:27017", "Name": "lc-local-appblueprint" } }application.ymlfor the Java blueprint... spring: ... data: mongodb: authentication-database: admin database: lc-blueprint-app uri: mongodb://localhost:27017 ssl-enabled: false auto-index-creation: false ...
Warning
If you decide to use a different database, you should also modify your code accordingly.
If you plan to package your app into a Docker container, here is a dedicated article for Testing with Docker.