commit | 9d69331da0c583539305c1abf1bd43ec0e1e8b56 | [log] [tgz] |
---|---|---|
author | Santhosh Thottingal <[email protected]> | Tue Dec 10 06:23:32 2024 +0000 |
committer | jenkins-bot <[email protected]> | Tue Jan 07 04:59:01 2025 +0000 |
tree | 652c0e8b29ae50baf929de863f947c245671122b | |
parent | 9326a0fde6c101605b3f434ed56471b203811e35 [diff] |
logging: 404s for page fetches are not application errors No need to handle it in application server. Route handling with http 404 is sufficient. Observed these 404 errors as application error log in logstash Bug: T377966 Change-Id: Ib8407f0e3334054c8324b076ee510ba810dce5b5
ContentTranslation is a tool that allows editors to translate pages from one language to another with the help of machine translation and other translation tools.
This is the server component of ContentTranslation.
Install the dependencies:
$ npm install
npm start
Then browse to http://localhost:8080/v2
An default configuration file is given as config.dev.yaml. Copy it to config.yaml to customize. Restart server to read changes.
To know more about registry configuration, see doc/Registry.md
npm run dev
This will run the application in hot reload mode. It means, your code changes will be immediately reflected in the running server.
This will also enable nodejs debugging in port 9229. To debug in Chrome dev tools, launch chrome://inspect/
in Chrome browser. You will see a remote target listed there, corresponding to cxserver.
If you are using an IDE like VS Code, it can connect to this debugging port and you can debug directly from your IDE. From 'Debug' menu, select 'attach'. Note that your launch configuration should look like as follows. The remoteRoot
is important
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "Attach", "port": 9229, "localRoot": "${workspaceRoot}/", "remoteRoot": "/usr/src/app/" }, { "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/app.js" } ] }
If you are familiar with Docker, this application can be developed easily using docker. From the cxserver directory, run this command once to install dependencies
docker-compose run cxserver npm install
Then
docker-compose up
This will start the cxserver in port 4000 (configurable by editing docker-compose.yaml) and you can launch the browser to localhost:4000/v2. This will also include hot reloading of your source code changes and opening up the debugger port as explained above.
To run the tests:
npm test