Page History
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
|
You can directly deploy the repository of a Node.js service to a node instance via the E2E Bridge.
Deploying a Node.js Service Repository via the
...
Bridge
Only users who are member of a group, to which the role ADMIN or MODELER has been assigned, are allowed to deploy Node.js services. Users, who have only MODELER access rights, may only replace a Node.js service, if they themselves or a member of the same group deployed it.
...
Option | Description | |||||
---|---|---|---|---|---|---|
Overwrite Service | If the Node.js service you want to deploy already exists, check this option, if you want to overwrite it. | |||||
Startup Service | To run, the Node.js service has to be started. Select this option, if you want the Node.js service to be started automatically right after its deployment. | |||||
Run 'npm install' | Select this option, if you want to run an 'npm install' after service deployment to get dependent Node.js packages (see Structure of a Node.js Service Repository further below).
| |||||
Preserve node_modules | Upon deployment of a Node.js service, the modules folder will get deleted, if existent. By setting this option you can keep these folders. This can be useful , if you do not want to perform an npm install on deployment. | |||||
Instance Name | You can overwrite the Node.js service name here. This is helpful, if you e.g. want to deploy the very same service multiple times with different names. |
After you have set the deployment options, deploy the service by clicking Upload.
If you have deployed a new service, it will be displayed in the navigation on the left, below the node instance, to which it has been deployed.
Noteinfo | ||
---|---|---|
| ||
You can only deploy Node.js services to the node instance the used Bridge is running on. If you have aggregated multiple node instances into a Bridge domain, you need to use the Bridge of the specific node instance you want to deploy the service to. |
Structure of a Node.js Service Repository
A Node.js service repository has to be a ZIP file containing at least two elements:
- A file package.json containing some service information the E2E Bridge needs for managing the service.
- All JavaScript source code and resources.
...
to |
...
. |
...
Structure of package.json
The following json elements are required in the file package.json:
Code Block | ||
---|---|---|
| ||
{
"name": "HelloWorld",
"version": "0.0.1",
"description": "Hello world HTTP server",
"scripts": {
"start": "node server.js"
},
} |
Element | Description | Mandatory |
---|---|---|
name | Contains the name of the Node.js service as displayed on the E2E Bridge. This is the name taken into account when applying the option Overwrite Service. | mandatory |
version | Contains the version of the Node.js service. | optional |
description | Contains a description of the Node.js service. | optional |
scripts/start | Contains the call to start the Node.js service: | mandatory |
Additional json elements can be added to package.json as needed (e.g. for adding packages/libraries), but will be ignored by the E2E Bridge.
Target Directory of the Deployment
Node.js services get deployed to a folder nodejs_<name of the service> in the E2E Bridge data directory of the node instance. This folder contains a sub-folder logs to store the logs in and a sub-folder repository which contains the java script file of the service and the package.json.
...