Skip to content

Conversation

thorwebdev
Copy link
Contributor

Bring the Func(🕺)

@thorwebdev thorwebdev requested review from inian and kiwicopple March 23, 2022 21:39
@inian inian marked this pull request as draft March 25, 2022 08:37
@thorwebdev thorwebdev marked this pull request as ready for review March 25, 2022 09:45
@thorwebdev thorwebdev merged commit 0c4f39c into master Mar 25, 2022
@thorwebdev thorwebdev deleted the feat/add-functions-js branch March 25, 2022 09:45
@ethndotsh
Copy link

It's happening...

Comment on lines +77 to +83
const isPlatform = _supabaseUrl.match(/(supabase\.co)|(supabase\.in)/)
if (isPlatform) {
const urlParts = _supabaseUrl.split('.')
this.functionsUrl = `${urlParts[0]}.functions.${urlParts[1]}.${urlParts[2]}`
} else {
this.functionsUrl = `${_supabaseUrl}/functions/v1`
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thorwebdev What is the purpose of this check right here? I was implemenntinng functions in Dart SDK, and was wondering.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to make local development using the CLI work.

Hosted:

  • SUPABASE_URL is https://{ref}.supabase.co
  • Function URL is https://{ref}.functions.supabase.co/{function-name}

Local:

  • SUPABASE_URL is http://localhost:{api-port}
  • Function URL is http://localhost:{api-port}/functions/v1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @soedirgo !

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

Successfully merging this pull request may close these issues.

5 participants