You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: configure_flagr.go
    path of file: ./repos/flagr/swagger_gen/restapi
    
    the code of the file until where you have to start completion: // Code generated by go-swagger; DO NOT EDIT.

package restapi

import (
	"crypto/tls"
	jsoniter "github.com/json-iterator/go"
	"net/http"
	"io"

	"github.com/openflagr/flagr/pkg/config"
	"github.com/openflagr/flagr/pkg/handler"
	"github.com/openflagr/flagr/swagger_gen/restapi/operations"
	"github.com/sirupsen/logrus"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
)

// This file is safe to edit. Once it exists it will not be overwritten

//go:generate swagger 
    
func configureAPI(api *operations.FlagrAPI) http.Handler {
	api.ServeError = errors.ServeError

	api.JSONConsumer = runtime.ConsumerFunc(func(reader io.Reader, data interface{}) error {
		json := jsoniter.ConfigFastest
		dec := json.NewDecoder(reader)
		dec.UseNumber()
		return dec.Decode(data)
	})

	api.JSONProducer = runtime.ProducerFunc(func(writer io.Writer, data interface{}) error {
		json := jsoniter.ConfigFastest
		enc := json.NewEncoder(writer)
		enc.SetEscapeHTML(false)
		return enc.Encode(data)
	})
	api.BinProducer = runtime.ByteStreamProducer()

	api.Logger = logrus.Infof
	api.ServerShutdown = config.ServerShutdown

	handler.Setup(api)
	return setupGlobalMiddleware(api.Serve(setupMiddlewares))
}