Development

To run the service, a running instance of the following backing services is required:

Refer to the system repository to start the backing-services before running the tests.

Building

Install dependencies:

npm install

Build the service:

# compile the code
npm run build

Running

Locally

Run the service in development mode:

# start service in development mode
npm run dev

Run the service in production mode:

# run compiled service
npm start

As a container

The service depends on a set of backing services that can be started using a dedicated docker compose definition.

docker run \
 --name restorecommerce_identity_srv \
 --hostname identity-srv \
 --network=restorecommerce \
 -e NODE_ENV=production \
 -p 50051:50051 \
 restorecommerce/<service name>-srv

Environment Definition

The environment is defined by the NODE_ENV environment variable and there are environment specific configuration files.

# Linux
export NODE_ENV="development"

# Windows
set NODE_ENV=development

Valid environment identifiers are:

  • development

  • production

Testing

Running the unit tests:

npm run test