You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Service.Handler() returns two values: the path of the service (base URI path) and the service handler function.
myservice:=relax.NewService("/api/v1")
// split the return of Handler()path, handler:=myservice.Handler()
// now use handler as you would with any other http.Handler...// for example, using TimeoutHandler to limit the time for requests.http.Handle(path, http.TimeoutHandler(handler, 3, "Time out!"))
log.Fatal(http.ListenAndServe(":8000", nil))
Update Alternatively, you can use Service.Adapter() which returns the service handler itself.