🎉 live server seems to be working now
This commit is contained in:
19
internal/live/web.go
Normal file
19
internal/live/web.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package live
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:embed web/index.html
|
||||
var webFS embed.FS
|
||||
|
||||
func staticHandler() http.Handler {
|
||||
sub, err := fs.Sub(webFS, "web")
|
||||
if err != nil {
|
||||
// Embed misconfiguration is a build-time bug; fall back to 404.
|
||||
return http.NotFoundHandler()
|
||||
}
|
||||
return http.FileServer(http.FS(sub))
|
||||
}
|
||||
Reference in New Issue
Block a user