MOD20: Test Application - GoranErdeljan/TINF19C-Team-4-Service-Registry GitHub Wiki
Created by Benedict Wetzel
1. Introduction
This module puts all its sub-modules together and creates the test application itself. It also contains the Dockerfile, that can be used to build a docker-image.
2. Requirements
The following requirements are covered by this module:
3. Prerequisites
In order to use this module the following prerequisites should be met:
- The developer should have a working computer that can access the internet
- The developer should use a Linux-based OS
- The developer should have Docker version 20.10.2 or higher installed
- The developer should have Node.js version 12.14.1 or higher installed
- The developer should have at least some basic experience with Node.js
4. Dependencies
This module depends on the following sub-modules:
- MOD21: Web-Inteface
- MOD22: Announce Service via DNS-SD
- MOD23: Register itself at the OI4-Service-Registry
- MOD24: DNS-SD-Listener
5. Technical overview
The file main.js is the entry point of the main docker application. It imports the sub-modules MOD21, MOD22, MOD23 and MOD24 using the require operator.
This module also controls the configuration of the application. To do so, it reads environment variables and creates a configuration object, that is then passed to the sub-modules. It also registers a callback with MOD24 to add found DNS-SD entries to the Web Interface (MOD21). The sub-modules are started with their respective start-functions.
The Dockerfile builds a docker-image, that includes this module and its sub-modules. For every sub-module 'npm install' is run to install their dependencies.