func NewServer(config *config.Config, opts ...Option) (*Server, error) {
	addr := net.JoinHostPort(config.HostAddress, config.HostPort)
	defaultServer := &http.Server{
		Addr:         addr,
		ReadTimeout:  Timeout,
		WriteTimeout: Timeout,
	}
	defaultStore, err := session.NewStore()
	if err != nil {
		return nil, err
	}
	defaultWebAuthn, _ := webauthn.New(&webauthn.Config{
		RPDisplayName: config.RelyingParty,
		RPID:          config.RelyingParty,
	})
	ws := &Server{
		config:   config,
		server:   defaultServer,
		store:    defaultStore,
		webauthn: defaultWebAuthn,
	}
	for _, opt := range opts {
		opt(ws)
	}
	ws.registerRoutes()
	return ws, nil
}
NewServer returns a new instance of a Server configured with the provided
configuration
package server
import (
	"context"
	"net"
	"net/http"
	"time"
	"log"
	"github.com/duo-labs/webauthn.io/config"
	"github.com/duo-labs/webauthn.io/session"
	"github.com/duo-labs/webauthn/webauthn"
	"github.com/gorilla/mux"
)
const Timeout = 5 * time.Second
type Option func(*Server)
type Server struct {
	server   *http.Server
	config   *config.Config
	webauthn *webauthn.WebAuthn
	store    *session.Store
}