package handlers import ( "fmt" "net/http" ) // HandleExperiment godoc // @Summary Testing msg preview // @Description Blank // @Accept json // @Produce json // @Param id query string true "ID of request" // @Router /experiment [get] func HandleExperiment(w http.ResponseWriter, r *http.Request) { // Get the "id" query parameter id := r.URL.Query().Get("id") if id == "" { http.Error(w, "missing id parameter", http.StatusBadRequest) return } // Build Open Graph tags dynamically title := fmt.Sprintf("Page for ID %s", id) url := fmt.Sprintf("https://dev-gw.cloud.fiskerinc.com/ota_update/expirment?id=%s", id) image := "https://www.google.com/url?sa=i&url=https%3A%2F%2Fulife.vpul.upenn.edu%2Fcareerservices%2Fblog%2F2010%2F11%2F12%2Fprofessionalism-and-the-pre-health-student-beyond-please-and-thank-you%2Ffunny-cat-green-avacado%2F&psig=AOvVaw3bK13MXk_hL91SyLrmdrMS&ust=1755886127191000&source=images&cd=vfe&opi=89978449&ved=0CBYQjRxqFwoTCODu-du_nI8DFQAAAAAdAAAAABAE" // Write headers w.Header().Set("Content-Type", "text/html; charset=utf-8") fmt.Fprintf(w, ` %s

Open Graph Page for %s

Preview metadata has been set in the HTML headers.

`, title, title, url, image, id, id) }