Skip to content

Commit

Permalink
Merge pull request #26 from Perlover/perlover/patch-1
Browse files Browse the repository at this point in the history
Fix of: If ALLOW_API is false then server is not run
  • Loading branch information
believethehype authored Nov 2, 2023
2 parents 6643dc0 + 5ba0b02 commit 3c31ebe
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,17 @@ func main() {
api.HandleFunc("/users/{name}@{domain}", GetUser).Methods("GET")
api.HandleFunc("/users/{name}@{domain}", UpdateUser).Methods("PUT")
api.HandleFunc("/users/{name}@{domain}", DeleteUser).Methods("DELETE")
}

srv := &http.Server{
Handler: cors.Default().Handler(router),
Addr: s.Host + ":" + s.Port,
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
log.Debug().Str("addr", srv.Addr).Msg("listening")

srv.ListenAndServe()
srv := &http.Server{
Handler: cors.Default().Handler(router),
Addr: s.Host + ":" + s.Port,
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
log.Debug().Str("addr", srv.Addr).Msg("listening")

}
srv.ListenAndServe()
}

func getDomains(s string) []string {
Expand Down

0 comments on commit 3c31ebe

Please sign in to comment.