Skip to content

Post "/rest/v1/[tableName]": unsupported protocol scheme "" #41

Open
@devhindo

Description

@devhindo

It shows this error Post "/rest/v1/emails": unsupported protocol scheme "" when deploying from render.com server but it works fine locally. I don't know where the problem is

type Emaildb struct {
	Name    string `json:"name"`
	Subject string `json:"subject"`
	To      string `json:"to"`
	Text    string `json:"text"`
	Date   string `json:"date"`
}

func AddMail(m Emaildb) {
	supabaseUrl := os.Getenv("SUPABASE_URL")
	supabaseKey := os.Getenv("SUPABASE_PRIVATE_KEY_SERVICE_ROLE")
	supabase := supa.CreateClient(supabaseUrl, supabaseKey)

	var results []types.Email

	err := supabase.DB.From("emails").Insert(m).Execute(&results)
	if err != nil {
		fmt.Println("cant insert email to db" + err.Error())
	}

	fmt.Println(results)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions