Compare commits
3 Commits
7bee78a875
...
53701d61f8
| Author | SHA1 | Date | |
|---|---|---|---|
| 53701d61f8 | |||
| 6d02eb092c | |||
| 21d4080baa |
@ -483,6 +483,15 @@ func (mg *Maingate) RegisterHandlers(ctx context.Context, serveMux *http.ServeMu
|
||||
}
|
||||
empty.prepare(mg)
|
||||
atomic.StorePointer(&mg.serviceptr, unsafe.Pointer(&empty))
|
||||
|
||||
filter := bson.M{"_id": empty.Id}
|
||||
_, _, err := mg.mongoClient.Update(CollectionService, filter, bson.M{
|
||||
"$set": &empty,
|
||||
}, options.Update().SetUpsert(true))
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
logger.Println("Service is registered :", mg.service().ServiceCode)
|
||||
|
||||
@ -606,6 +606,8 @@ func (sh *serviceDescription) ServeHTTP(w http.ResponseWriter, r *http.Request)
|
||||
r.Body.Close()
|
||||
}()
|
||||
|
||||
logger.Println("serviceDesc :", sh.ServiceCode, r.URL.Path)
|
||||
|
||||
if strings.HasSuffix(r.URL.Path, "/auth") {
|
||||
sh.authorize(w, r)
|
||||
} else if strings.HasSuffix(r.URL.Path, "/link") {
|
||||
|
||||
Reference in New Issue
Block a user