Skip to content

Commit

Permalink
fix empty dashboard when load-audit-file not specified (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Brennan authored Sep 18, 2019
1 parent c91a85a commit 2e44d15
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ func main() {
}

func startDashboardServer(c conf.Configuration, auditPath string, loadAuditFile string, port int, basePath string) {
var auditData validator.AuditData
var auditDataPtr *validator.AuditData
if loadAuditFile != "" {
auditData = validator.ReadAuditFromFile(loadAuditFile)
auditData := validator.ReadAuditFromFile(loadAuditFile)
auditDataPtr = &auditData
}
router := dashboard.GetRouter(c, auditPath, port, basePath, &auditData)
router := dashboard.GetRouter(c, auditPath, port, basePath, auditDataPtr)
router.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("OK"))
})
Expand Down

0 comments on commit 2e44d15

Please sign in to comment.