Files
AetherForge/server/internal/builder/launch_template_handler.go
AetherForge 7191bda6fd Add EC2 Launch Template strain genesis for AWS horizontal scale.
Ship POST /api/v1/forge/launch-template with cloud-init user-data embedding genesis snapshot hash and strain card ID; first template-tagged auth pins SpreadGeneration=0 and ParentAgentID=template.
2026-06-07 09:59:29 -07:00

25 lines
615 B
Go

package builder
import (
"encoding/json"
"net/http"
)
func (h *Handler) ServeLaunchTemplate(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
return
}
var req LaunchTemplateRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
writeJSON(w, http.StatusBadRequest, LaunchTemplateResponse{Success: false, Error: "invalid JSON"})
return
}
resp, err := BuildLaunchTemplateArtifacts(req)
if err != nil {
writeJSON(w, http.StatusBadRequest, resp)
return
}
writeJSON(w, http.StatusOK, resp)
}