Skip to content

Commit

Permalink
clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
olliephillips committed Apr 29, 2022
1 parent 7fa6f7f commit e99470f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmd/dujour/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func init() {
}

// add self-signed certificate only if folder empty, if the cert expires it
// it can be deleted so the code here create a new cert.pem and key.pem files
// it can be deleted so the code here creates a new cert.pem and key.pem file
checkExist := fmt.Sprintf("%s/cert.pem", internal.TLS_FOLDER)
if _, err := os.Stat(checkExist); errors.Is(err, os.ErrNotExist) {
logger.Info("Creating self-signed TLS certificate for the server")
Expand Down Expand Up @@ -86,7 +86,7 @@ func main() {
}
}()

// we need three handlers, they need logger and datasources
// handlers
mux := mux.NewRouter()
app := &routes.App{
Logger: logger,
Expand All @@ -99,7 +99,7 @@ func main() {
mux.HandleFunc("/{datasource:[a-z0-9=\\-\\/]+}/{id:[a-zA-Z0-9=\\-\\/]+}", app.DatasourceGetByID).Methods("GET")
mux.HandleFunc("/{datasource:[a-z0-9=\\-\\/]+}", app.DatasourceGetAll).Methods("GET")

// create a server running as service
// create a server
hostPort := net.JoinHostPort(internal.SRV_HOST, internal.SRV_PORT)
srvTLS := &http.Server{
Addr: hostPort,
Expand All @@ -114,6 +114,3 @@ func main() {
logger.FatalError("Failed to start HTTPS server", err)
}
}

// TODO
// get tests in place on the work done so far

0 comments on commit e99470f

Please sign in to comment.