func (s *server) handle(method, path string, handler http.Handler, mw ...Middleware) {

	// First wrap the handler with its specific middleware
	handler = wrapMiddleware(mw, handler)

	// Then wrap the handler in the server's middleware
	handler = wrapMiddleware(s.mw, handler)

	// Create the function to execute for each request
	h := func(w http.ResponseWriter, r *http.Request, params map[string]string) {

		// Update request context with the required details to process the request
		r = SetDetails(r, path, params)

		// Call the wrapped handler
		handler.ServeHTTP(w, r)
	}

	// Register the handler to the router
	s.router.Handle(method, path, h)
}
// handle registers handlers with the given middleware to the server's router
handle registers handlers with the given middleware to the server's router
// handle registers handlers with the given middleware to the server ' s router
func (s *server) handle(method, path string, handler http.Handler, mw ...Middleware) {
	handler = wrapMiddleware(mw, handler)
	handler = wrapMiddleware(s.mw, handler)
	h := func(w http.ResponseWriter, r *http.Request, params map[string]string) {
		r = SetDetails(r, path, params)
		handler.ServeHTTP(w, r)
	}
	s.router.Handle(method, path, h)
}
func ( s * server ) handle ( method , path string , handler http . Handler , mw ... Middleware ) { handler = wrapMiddleware ( mw , handler ) handler = wrapMiddleware ( s . mw , handler ) h := func ( w http . ResponseWriter , r * http . Request , params map [ string ] string ) { r = SetDetails ( r , path , params ) handler . ServeHTTP ( w , r ) } s . router . Handle ( method , path , h ) }
handle registers handlers with the given middleware to the server's router
handle registers handlers with the given middleware to the server ' s router
// First wrap the handler with its specific middleware // Then wrap the handler in the server's middleware // Create the function to execute for each request // Update request context with the required details to process the request // Call the wrapped handler // Register the handler to the router