mirror of
https://github.com/Luzifer/password.git
synced 2024-12-19 20:31:18 +00:00
Fix: Log error when listen is not possible
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
af53a31d2c
commit
9a24ca807b
1 changed files with 3 additions and 1 deletions
|
@ -37,7 +37,9 @@ func actionCmdServe(cmd *cobra.Command, args []string) {
|
|||
r.HandleFunc("/v1/getPassword", handleAPIGetPasswordv1).Methods("GET")
|
||||
|
||||
http.Handle("/", r)
|
||||
http.ListenAndServe(fmt.Sprintf(":%d", flags.Server.Port), nil)
|
||||
if err := http.ListenAndServe(fmt.Sprintf(":%d", flags.Server.Port), nil); err != nil {
|
||||
log.Fatalf("listening on port :%d: %s", flags.Server.Port, err)
|
||||
}
|
||||
}
|
||||
|
||||
func handleAPIGetPasswordv1(res http.ResponseWriter, r *http.Request) {
|
||||
|
|
Loading…
Reference in a new issue