package handlers import ( "cs-bridge/internal/config" "net/http" "net/url" "path" "github.com/google/uuid" ) func Entry(cfg *config.CodeServer) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { workspaceID := uuid.NewString() workspacePath := path.Join(cfg.WorkspaceRoot, workspaceID) redirectURL, _ := url.Parse(cfg.BaseURL) q := redirectURL.Query() q.Set("folder", workspacePath) redirectURL.RawQuery = q.Encode() http.Redirect(w, r, redirectURL.String(), http.StatusFound) } }