2.2.1 • Published 4 months ago

@tzmedical/trident-server v2.2.1

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
4 months ago

Trident Server

npm version Docker Version node version fastify version

CircleCI npm downloads Docker Pulls

This repository contains an example Node.js server designed to receive and process data uploaded from TZ Medical's Trident line of cardiac monitors.

Deployment

This server application can be deployed several different ways depending on your requirements. It can be run directly as an npm package, or it can be pulled as a docker image and run in any environment that supports containers. There is also a helm chart is available for kubernetes deployments.

Node.js

To run the server as an npm package, you can do one of the following:

# Install the package globally
npm i -g @tzmedical/trident-server
# Start the server on port 80
trident-server start -p 80

### OR ###

# Run the server using npx at the default port (3000)
npx @tzmedical/trident-server start

Docker

A docker image containing this server application is available on Docker Hub at tzmedical/trident-server. It can be pulled using the following command:

# Pull the application Docker image
docker pull tzmedical/trident-server

Helm

The Helm chart is available from Google Cloud Storage. To use it to install the server in your cluster, use the following commands to install as my-trident-server:

# Add the repository
helm repo add trident-server https://storage.googleapis.com/trident-server
# Install the chart
helm install my-trident-server trident-server/trident-server

Configuration

The following configuration options are available as either cli flags or environment variables:

CLI flagEnvironment VariableHelm ChartDefaultDescription
-p, --portNODE_PORTservice.port80Sets the port for the application to listen on
--postFORWARDING_URL_LISTforwardingUrls[]Sets a list of URLs to POST the parsed file contents to
FORWARDING_TIMEOUT_MSforwardingTimeoutMs30000Sets the timeout for forwarding POST requests
--redis-masterREDIS_MASTER_HOST-automatic-''Sets the hostname for the Redis master instance
--redis-replicasREDIS_REPLICAS_HOST-automatic-''Sets the hostname for the Redis replicas
--redis-passwordREDIS_PASSWORD-automatic-''Sets the password
--log-levelLOG_LEVELlogLevel'info'Sets the logging level for the application server
--pretty-logsPRETTY_FORMAT_LOGSprettyLogsfalseSet to use pretty-print formatting for logs
--pubsub-enabledPUBSUB_ENABLEDpubsub.enabled''Set to enable use of google-pubsub
--pubsub-receivedPUBSUB_RECEIVED_TOPICpubsub.receivedTopictrident-server-file-receivedSet to override the default topic name
--pubsub-actionsPUBSUB_ACTIONS_TOPICpubsub.actionsTopictrident-server-actions-queueSet to override the default topic name
--pubsub-subscriptionPUBSUB_SUBSCRIPTIONpubsub.subscriptiontrident-server-actions-queueSet to override the default subscription name
GOOGLE_APPLICATION_CREDENTIALSgoogleCredentialsSet to provide Google application credentials

Development

When developing and testing locally, a Redis server is needed. This is also required for npm test to succeed, as it expects to find a Redis instance on the default port at localhost. There are a number of options to achieve this.

  • Memurai Developer (Windows): The official Windows version requires WSL and is complicated to install. Instead, Memurai can be quickly installed via chocolatey. By default, it creates a Windows service so you can be up and running quickly.
  • Official Redis Sever (Linux): On Linux, the redis server can be installed using apt-get relatively easily.
  • Using a Docker Container (Any): There is a Redis image available on Docker Hub that can be used as well. This is what our automated testing uses.

Local testing also requires an emulator for Google's pubsub service. This can be installed with the following commands:

gcloud components install beta pubsub-emulator --quiet
gcloud components update --quiet
2.3.0-alpha.2

4 months ago

2.3.0-alpha.1

4 months ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.3-alpha.1

2 years ago

2.1.3-alpha.2

2 years ago

2.1.2

3 years ago

2.1.2-alpha.1

3 years ago

1.10.5

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0-alpha.1

3 years ago

2.0.0-alpha.2

3 years ago

2.0.0

3 years ago

1.13.9

3 years ago

1.13.8

3 years ago

1.13.7

3 years ago

1.13.6

3 years ago

1.13.5

3 years ago

1.13.4

3 years ago

1.13.3

3 years ago

1.13.2

3 years ago

1.13.1

3 years ago

1.13.0

3 years ago

1.13.0-alpha.1

3 years ago

1.12.3

3 years ago

1.12.3-alpha.3

3 years ago

1.12.3-alpha.2

3 years ago

1.12.3-alpha.1

3 years ago

1.12.2

3 years ago

1.12.1

3 years ago

1.10.4

3 years ago

1.10.3

3 years ago

1.12.0

3 years ago

1.10.2

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.9.2

3 years ago

1.11.0

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.7.0

3 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago