accordproject / template-archive

Smart Legal Contracts & Templating System
https://accordproject.org/projects/cicero/
Apache License 2.0
280 stars 119 forks source link

CICERO_PORT does not set Cicero Server port properly #715

Closed mgiofinc closed 1 year ago

mgiofinc commented 2 years ago

Bug Report 🐛

According to the Cicero Server readme, the default port for the server is 6001 and you can set a different port as an environment variable CICERO_PORT. But if CICERO_PORT=9001, the Cicero Server port is set to 14201.

Expected Behavior

Running the following commands, shall set the Cicero Server port to 9001:

export CICERO_PORT=9001
cicero-server

Current Behavior

Running the following commands, the Cicero Server port is set to 14201 instead of 9001:

export CICERO_PORT=9001
cicero-server

Possible Solution

App.js shall be fixed at const PORT = process.env.CICERO_PORT | 6001;, replacing the bitwise OR operator (|) with the OR operator (||) or better the nullish coalescing operator (??).

Steps to Reproduce

Running the following commands, the Cicero Server port is set to 14201 instead of 9001:

export CICERO_PORT=9001
cicero-server