Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
devhindo opened this issue Dec 8, 2023 · 2 comments
Open

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

devhindo opened this issue Dec 8, 2023 · 2 comments

Comments

@devhindo
Copy link

devhindo commented Dec 8, 2023

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)
}
@devhindo
Copy link
Author

devhindo commented Dec 8, 2023

I think it has something to do with this

@stav
Copy link

stav commented Apr 6, 2024

I had the same error when I forgot to set my environment variables for the supabase url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants