`import { Client } from 'node-appwrite';
export default async ({ req, res, log, error }) => { // Initialize Appwrite const client = new Client() .setEndpoint('api.example.com') .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) .setKey(process.env.APPWRITE_API_KEY);
// Init database const database = new client.Databases(client)`
error: TypeError: client.Databases is not a constructor at Module.default (file:///usr/local/server/src/function/src/main.js:28:20) at execute (/usr/local/server/src/server.js:141:48) at async /usr/local/server/src/server.js:158:13
Function was made with the starter template.
Databases is not a valid constructor functions
Recommended threads
- Custom API domain is unreachable
Earlier my custom api domain was working fine. Now it seems to be offline without a trace a few hours later. I didn't change anything, all the relevant DNS reco...
- "Invalid console fingerprint" when unpau...
I've tried logging out and logging back in, still can't figure out why this is happening.
- Inviting members while SMTP is disabled ...
Issue: https://github.com/appwrite/console/issues/3125 PR: https://github.com/appwrite/console/pull/3126