Use static servers for serving embedded web assets

This commit is contained in:
Gabe Kangas
2022-06-20 22:12:44 -07:00
parent 18a184eeb7
commit 9c477e16a2
4 changed files with 10 additions and 90 deletions

View File

@@ -4,23 +4,10 @@ import (
"net/http"
"path/filepath"
"github.com/owncast/owncast/models"
"github.com/owncast/owncast/router/middleware"
"github.com/owncast/owncast/utils"
)
// MetadataPage represents a server-rendered web page for bots and web scrapers.
type MetadataPage struct {
RequestedURL string
Image string
Thumbnail string
TagsString string
Summary string
Name string
Tags []string
SocialHandles []models.SocialHandle
}
// IndexHandler handles the default index route.
func IndexHandler(w http.ResponseWriter, r *http.Request) {
middleware.EnableCors(w)
@@ -32,19 +19,6 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) {
return
}
// If the ETags match then return a StatusNotModified
// if responseCode := middleware.ProcessEtags(w, r); responseCode != 0 {
// w.WriteHeader(responseCode)
// return
// }
// If this is a directory listing request then return a 404
// info, err := os.Stat(path.Join(config.WebRoot, r.URL.Path))
// if err != nil || (info.IsDir() && !isIndexRequest) {
// w.WriteHeader(http.StatusNotFound)
// return
// }
// Set a cache control max-age header
middleware.SetCachingHeaders(w, r)