func PathFormat(url *url.URL) string {
	path := url.EscapedPath()
	if strings.HasSuffix(path, ".html") {
		return FormatHTML
	}
	return FormatJSON
}
PathFormat gets the data format for a path
package api
import (
	"net/http"
	"net/url"
	"strings"
)
const (
	ContentTypeJSON = "application/json"
	ContentTypeGeoJSON = "application/geo+json"
	ContentTypeHTML = "text/html"
	ContentTypeOpenAPI = "application/vnd.oai.openapi+json;version=3.0"
	FormatJSON = "json"
	FormatHTML = "html"
)
func ContentType(format string) string {
	switch format {
	case FormatJSON:
		return ContentTypeJSON
	case FormatHTML:
		return ContentTypeHTML
	}
	return ""
}