mirror of
https://github.com/believethehype/nostdress.git
synced 2026-07-20 13:28:09 -07:00
If ALLOW_API is false then server is not run
I think it will be fix Issue: https://github.com/believethehype/nostdress/issues/25
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user