# SLA Metrics Public Dashboard Server Github Repo: https://github.com/ethersphere/SLA-Intermediate-Server ## Installing and Starting ``` npm install npm start ``` ## Database The server is a NodeJS Express server which requires a MongoDB database and the Swarm mainnet Prometheus endpoint. I have been using MongoDB cloud, but it would be better to have one on Swarm's own servers. A connection string is required, this is the format of the connection string I have used from MongoDB cloud: ``` mongodb+srv://noah:<password>@cluster0.it21v.mongodb.net/?retryWrites=true&w=majority .env ``` ## Environment Variables Environment variables are set in a .env file. Sample .env file: ```json <!-- Fill in your values and change file name to .env --> PROMETHEUS=http://prometheus-bee.mainnet.internal/api/v1/ MONGO=mongodb+srv://noah:GD2hI78zsnyrkSIq@cluster0.it21v.mongodb.net/?retryWrites=true&w=majority .env ``` The connection string should be set into a MONGO environment variable. Additionally, a Prometheus endpoint for the Swarm mainnet Prometheus is required. I have been using this endpoint: http://prometheus-bee.mainnet.internal/api/v1/. The endpoint should be set to the PROMETHEUS environment variable ## Webhook A webhook should be set up to redeploy the server from the main Github branch when a new tag is created. ![image](https://hackmd.io/_uploads/BJv_VaLUT.png)