Skip to content

Commit

Permalink
chore: fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hbollon committed Oct 26, 2023
1 parent e6cd67c commit 729fc27
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 0 additions & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ func (db *Database) ListStateStats(query url.Values) (states []types.StateStat,

var paginationQuery string
var params []interface{}
page = 1
if v := string(query.Get("page")); v != "" {
page, _ = strconv.Atoi(v) // TODO: err
offset := (page - 1) * pageSize
Expand Down
17 changes: 15 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,27 @@ func main() {
// Add CORS Middleware to mux router
r.Use(corsMiddleware)

// Create server
server := &http.Server{
Addr: fmt.Sprintf(":%v", c.Web.Port),
Handler: r,
ReadHeaderTimeout: 3 * time.Second,
}

// Start server
log.Debugf("Listening on port %d\n", c.Web.Port)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%v", c.Web.Port), r))
log.Fatal(server.ListenAndServe())
}

func serveSwagger(port int, router *mux.Router) {
server := &http.Server{
Addr: fmt.Sprintf(":%v", port),
Handler: router,
ReadHeaderTimeout: 3 * time.Second,
}

log.Infof("Serving swagger on port %d", port)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%v", port), router))
log.Fatal(server.ListenAndServe())
}

// spaHandler implements the http.Handler interface, so we can use it
Expand Down

0 comments on commit 729fc27

Please sign in to comment.