From a00ae567375222a8afa65579ac0290ff1ebe6b26 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 21 Jun 2020 17:40:38 +0000 Subject: move HTML+JS to separate file I got fed up with rebuilding every time I changed something; plus, syntax highlight is easier this way --- main.go | 75 ----------------------------------------------------------------- 1 file changed, 75 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 947fad0..42c8fbf 100644 --- a/main.go +++ b/main.go @@ -13,75 +13,6 @@ import ( "github.com/pion/webrtc/v2" ) -const homeHTML = ` - - - synced-playback - - - - -
- - - - -
- - - - -` - var ( upgrader = websocket.Upgrader{ ReadBufferSize: 1024, @@ -138,7 +69,6 @@ func main() { pipeline = gst.CreatePipeline(containerPath, audioTrack, videoTrack) pipeline.Start() - http.HandleFunc(httpPath, serveHome) http.HandleFunc(httpPath + "/ws/", serveWs) fmt.Println(fmt.Sprintf("Video file '%s' is now available on '%s', have fun!", containerPath, httpListenAddress)) @@ -236,8 +166,3 @@ func serveWs(w http.ResponseWriter, r *http.Request) { } } } - -func serveHome(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/html; charset=utf-8") - fmt.Fprintf(w, homeHTML) -} -- cgit v1.2.3