diff options
| author | Julian Hurst <julian.hurst92@gmail.com> | 2020-10-14 20:36:53 +0200 |
|---|---|---|
| committer | Julian Hurst <julian.hurst92@gmail.com> | 2020-10-14 20:36:53 +0200 |
| commit | e670f9d19f658055e169b6d7c3ae57ddc11c3eee (patch) | |
| tree | 01fa0c8c89d3a847a5ce2e629a5ee7fa8c5264b8 /grimtube.go | |
| parent | 8891eea532102b58a23a71a491be2c3f151720b5 (diff) | |
| download | grimtube-e670f9d19f658055e169b6d7c3ae57ddc11c3eee.tar.gz | |
Add embed and halloween theme
Diffstat (limited to 'grimtube.go')
| -rw-r--r-- | grimtube.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/grimtube.go b/grimtube.go index 6751543..a804f09 100644 --- a/grimtube.go +++ b/grimtube.go @@ -69,11 +69,22 @@ func search(w http.ResponseWriter, r *http.Request) { } } +func embed(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case "GET": + query := r.URL.Query() + id := query.Get("id") + serve(w, "templates/embed.html", id) + default: + } +} + func main() { fs := http.FileServer(http.Dir("static")) http.Handle("/static/", http.StripPrefix("/static/", fs)) http.HandleFunc("/", index) http.HandleFunc("/search", search) + http.HandleFunc("/embed", embed) log.Fatal(http.ListenAndServe(":8080", nil)) |
