|
@@ -20,6 +20,8 @@ import (
|
|
// func HandleAppStatus() http.Handler
|
|
// func HandleAppStatus() http.Handler
|
|
// func HandleFile(data, contentType string) http.Handler
|
|
// func HandleFile(data, contentType string) http.Handler
|
|
// func HandleImagePng(data string) http.Handler
|
|
// func HandleImagePng(data string) http.Handler
|
|
|
|
+// func HandleTextJavaScript(data string) http.Handler
|
|
|
|
+// func HandleTextPlain(data string) http.Handler
|
|
// func MinifyHtmlCode(str string) string
|
|
// func MinifyHtmlCode(str string) string
|
|
// func RespondAsBadRequest(w http.ResponseWriter, r *http.Request, err error)
|
|
// func RespondAsBadRequest(w http.ResponseWriter, r *http.Request, err error)
|
|
// func RespondAsMethodNotAllowed(w http.ResponseWriter, r *http.Request)
|
|
// func RespondAsMethodNotAllowed(w http.ResponseWriter, r *http.Request)
|
|
@@ -87,6 +89,14 @@ func HandleImagePng(data string) http.Handler {
|
|
return HandleFile(data, "image/png")
|
|
return HandleFile(data, "image/png")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func HandleTextJavaScript(data string) http.Handler {
|
|
|
|
+ return HandleFile(data, "text/javascript")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func HandleTextPlain(data string) http.Handler {
|
|
|
|
+ return HandleFile(data, "text/plain")
|
|
|
|
+}
|
|
|
|
+
|
|
func MinifyHtmlCode(str string) string {
|
|
func MinifyHtmlCode(str string) string {
|
|
str = mHtml.ReplaceAllString(str, "><")
|
|
str = mHtml.ReplaceAllString(str, "><")
|
|
str = mHtmlLeft.ReplaceAllString(str, ">")
|
|
str = mHtmlLeft.ReplaceAllString(str, ">")
|