KNoT Cloud UI

Clone this repo:

Branches

  1. f801a67 Add thing management option to app registration by João Neto · 3 years, 8 months ago master
  2. c661334 Bump to v1.0.1 by Thiago Cardoso · 3 years, 9 months ago
  3. 6eb2432 Specify path in WebSocket server by Thiago Cardoso · 3 years, 9 months ago
  4. a887ac9 Bump to v1.0.0 by Thiago Cardoso · 3 years, 9 months ago
  5. f9da26a Bump @cesarbr/knot-cloud-websocket to v1.0.1 by Thiago Cardoso · 3 years, 9 months ago

knot-cloud-ui

KNoT Cloud UI.

Installation and usage

This service is part of the KNoT Cloud and requires a subset of its service to work. It is a React front-end and a small Express server that act as a proxy to the actual API service.

Configuration

Configuration is made via environment variables. The configuration parameters are:

  • PORT Number Server port number. (Default: 80|3000)
  • API_HOSTNAME String API service hostname. (Default: localhost)
  • API_PORT Number API service port. (Default: 3003)
  • WS_HOSTNAME String WebSocket adapter hostname. (Default: localhost)
  • WS_PORT Number WebSocket adapter port. (Default: 3004)

Build and run (local)

First, install the dependencies:

yarn

Then:

yarn build
yarn start:server

Build and run (local, development)

First, install the dependencies:

yarn

Then, start the server with auto-reload:

yarn start

Build and run (Docker, development)

A development container is specified at Dockerfile-dev. To use it, execute the following steps:

  1. Build the image:

    docker build . -f Dockerfile-dev -t knot-cloud-ui-dev
    
  2. Create a file containing the configuration as environment variables.

  3. Run the container:

    docker run --env-file ui.env -p 4000:80 -v `pwd`:/usr/src/app -ti knot-cloud-ui-dev
    

The first argument to -v must be the root of this repository, so if you are running from another folder, replace `pwd` with the corresponding path.

This will start the server with auto-reload.

Run (Docker)

Containers built from the master branch and the published tags in this repository are available on DockerHub.

  1. Create a file containing the configuration as environment variables.
  2. Run the container:
docker run --env-file ui.env -p 4000:80 -ti cesarbr/knot-cloud-ui

Verify

Point your browser to http://<hostname>:<port>.