func NewServer(listenAddr string, service Service) (*http.Server, error) {
	httpServer := &http.Server{
		Addr:    listenAddr,
		Handler: createMux(service),
	}
	go func() {
		if err := httpServer.ListenAndServe(); err != nil && err != http.ErrServerClosed {
			log.Errorf("stopping http server: %s", err)
		}
	}()
	log.Infof("http server started at %s", listenAddr)
	return httpServer, nil
}
NewServer returns a new http server for bidbot commands.
package httpapi
import (
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"net/url"
	"strings"
	"github.com/textileio/bidbot/buildinfo"
	"github.com/textileio/bidbot/lib/auction"
	"github.com/textileio/bidbot/lib/datauri"
	bidstore "github.com/textileio/bidbot/service/store"
	"github.com/textileio/go-libp2p-pubsub-rpc/peer"
	golog "github.com/textileio/go-log/v2"
)
var (
	log = golog.Logger("bidbot/api")
)
type Service interface {
	PeerInfo() (*peer.Info, error)
	ListBids(query bidstore.Query) ([]*bidstore.Bid, error)
	GetBid(id auction.BidID) (*bidstore.Bid, error)
	WriteDataURI(payloadCid, uri string) (string, error)
	SetPaused(paused bool)
}