httpServer.go 412 B

123456789101112131415161718192021
  1. package httpservers
  2. import (
  3. config "github.com/OliveTin/OliveTin/internal/config"
  4. )
  5. // StartServers will start 3 HTTP servers. The WebUI, the Rest API, and a proxy
  6. // for both of them.
  7. func StartServers(cfg *config.Config) {
  8. go startWebUIServer(cfg)
  9. if cfg.UseSingleHTTPFrontend {
  10. go StartSingleHTTPFrontend(cfg)
  11. }
  12. if cfg.Prometheus.Enabled {
  13. go StartPrometheus(cfg)
  14. }
  15. startRestAPIServer(cfg)
  16. }