Illust API
The Firebase Cloud Functions for the Illust marketplace and WebAR sites.
This uses Express/Typescript to set up the cloud functions.
Testing
To run spin up the Firebase emulator, and run all tests:
However, it can be faster to run the emulator in a separate terminal, so it doesn't have to spin up every time. To do that, run the following commands in separate terminals:
This also lets you more easily specify a path to test, like:
Valid user accounts
There is one valid user account set up for testing. Here are the credentials:
Auth Token: good-token
User UID: alice
See setupTests.ts for more details.
Configuration
Instead of env vars, firebase cloud functions have their own configuration system. For local development, add values to ./.runtimeconfig.json. For prod and staging, use:
Default values are stored in src/defaultConfig.ts
Setting Up An endpoint and collection
Update firebase.json rewrites with source and function name. Wild cards are supported ex:
If adding a new collection add it to the
shared
package and export the interface. exVerify your route has appropriate CORS settings
Last updated