Server
Functions

Functions

(WiP Docs)

Prerequisites

Serve Functions

If developing functions locally run via

yarn nx run picsa-server:supabase functions serve

Functions can be called from any rest client.

Authorization credentials should be provided using the service_role key output when server started or by calling nx run picsa-server:supabase status

https://supabase.com/docs/guides/functions/local-development (opens in a new tab)

Test Functions

Whilst serving functions tests can be executed by

yarn nx run picsa-server:test-functions

In order to run tests that connect to supabase an additional .env.local file should be populated in the the functions directory with SUPABASE_ANON_KEY credentials

Tests are written using the Behavior-Driven Development (opens in a new tab) module

Functions cli supports additional arguments (opens in a new tab) such as --watch

yarn nx run picsa-server:test-functions --watch

Deploy Functions

supabase functions deploy