devicehive / devicehive-backend-node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DeviceHive Backend service (NodeJS implementation)

Start up

Before start Backend application the next components should be ready to use:

  • Postgresql Database
  • Hazelcast Database
  • DeviceHive WS Proxy

To start backend application just use next command:

node ./application/DeviceHiveBackendApplication.js

Configuration

Application

[path-to-backend-project]/application/config.json
  • LOGGER_LEVEL - Application logging level (default: "info")
  • PROXY_SUBSCRIPTION_GROUP - "backend_subscription_group"
  • CLUSTER_WORKERS - Number of workers in cluster or "cpu" as amount of cores in cpu (default: "cpu")
  • CLUSTER_COMMUNICATOR_TYPE - Interprocess communicator type. Can be "ipc" or "udp" (default: "ipc")
  • CLUSTER_COMMUNICATOR_PORT - Port for "udp" CLUSTER_COMMUNICATOR_TYPE

Each configuration field can be overridden with corresponding environmental variable with "BACKEND" prefix, for example:

BACKEND.LOGGER_LEVEL=debug

Prefix separator can be overridden by ENVSEPARATOR environmental variable. Example:

ENVSEPARATOR=_
BACKEND_LOGGER_LEVEL=debug

DeviceHive WS Proxy client

[path-to-backend-project]/proxy/config.json
  • WS_PROXY_ENDPOINT - URL to WebSocket server of DeviceHive WS Proxy (default: "ws://localhost:3000")

Each configuration field can be overridden with corresponding environmental variable with "PROXY" prefix, for example:

PROXY.WS_PROXY_ENDPOINT=ws://localhost:3001

Prefix separator can be overridden by ENVSEPARATOR environmental variable. Example:

ENVSEPARATOR=_
PROXY_WS_PROXY_ENDPOINT=ws://localhost:3001

Postgres

[path-to-backend-project]/db/server/config.json
  • HOST - Postgres server host (default: "localhost")
  • PORT - Postgres server port (default: 5432)
  • DATABASE - Postgres database name (default: "devicehive")
  • PASSWORD - Postgres user password (default: "12345")
  • USER - Postgres user login (default: "postgres")

Each configuration field can be overridden with corresponding environmental variable with "POSTGRES" prefix, for example:

POSTGRES.PORT=6000

Prefix separator can be overridden by ENVSEPARATOR environmental variable. Example:

ENVSEPARATOR=_
POSTGRES_PORT=6000

Hazelcast

[path-to-backend-project]/service/hazelcast/config.json
  • ADDRESSES - List of Hazelcast servers addresses separated by comma (default: "127.0.0.1:5701,")
  • GROUP_NAME - Hazelcast group name (default: "dev")
  • GROUP_PASSWORD - Hazelcast group password (default: "dev-pass")
  • EVENT_THREAD_COUNT - Event Threading configuration (default: 5)
  • LOGGING - Hazelcast logging level (default: "off")

Each configuration field can be overridden with corresponding environmental variable with "HAZELCAST" prefix, for example:

HAZELCAST.GROUP_NAME=dev2

Prefix separator can be overridden by ENVSEPARATOR environmental variable. Example:

ENVSEPARATOR=_
HAZELCAST_GROUP_NAME=dev2

About


Languages

Language:JavaScript 100.0%