diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-05-16 22:04:14 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-05-16 22:04:14 -0500 |
| commit | 1316aa7ca5e1668bbb7967264540bff3c8dbef86 (patch) | |
| tree | cc6a4121c13d31a96060e3fa9103ed314578c8cc /main.go | |
| parent | 3bfeed5a50cd1bb405cbe145611410fa4f628413 (diff) | |
| download | embedtube-1316aa7ca5e1668bbb7967264540bff3c8dbef86.tar.xz embedtube-1316aa7ca5e1668bbb7967264540bff3c8dbef86.zip | |
new api implemented server-side
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -30,15 +30,16 @@ func main() { apiKey = os.Getenv("API_KEY") // setup routes - setupRoutesAPI() - setupRoutesWatch() + mux := http.NewServeMux() + registerRoutesAPI(mux, &APISourceOfficial{}) + registerRoutesWatch(mux) setupHome() - http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) - http.HandleFunc("/", rootHandler) + mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) + mux.HandleFunc("/", rootHandler) // start http server log.Println("Listening on http://localhost:8080") - err := http.ListenAndServe(":8080", nil) + err := http.ListenAndServe(":8080", mux) if err != nil { log.Fatal(err) } |
