Express-cloud-setup

This app is Express.js based exercise of simple cloud based app connected to different services like, influxdb, postgres, SQLite, logstash, Prometheus.

default app port: 3000

TL;DR

To run the app execute : "npm run start" To enable connection to additional services like influx,logstash etc. Uncomment their section in config.yaml and run those services.

You can only run 1 database at a time (SQLite or Postgres)

How-To

Start the app

Execute "npm run start" If You are using VS-code You can just use launch.json from .vscode folder

To debug the app

Execute "npm run start:debug" or use launch.json

To run end-to-end tests

Execute "npm run test:e2e

To run unit tests

Execute "npm run test

To generate git.properties

Execute "npm run saverepoinfo"

To generate contract tests

Execute "npm run test:contract"

To verify contract tests

Execute "npm run test:contract-verifier"

Run the simplified app in docker

To run the most basic configuration of the app + postgres db, You can use docker-compose.yml. For the app to work correctly when containers are up please create and run migrations from the localhost or add script to do so.

Command : "docker-compose up" or "docker-compose up --build" if You want to rebuild this app image (if it is present).

To run everything in docker You have to adjust docker-compose.yml

Deploy app to kubernetes

To create deployment and service You can use express-deployment/service.yaml with command "kubectl apply (-f FILENAME | -k DIRECTORY)" If You want deployment/service to work remember to use proper name whe creating and pushing app docker build and to properly set Prometheus port to properly scrap metrics (default prometheus port is 8080 when deployed through helm-chart).