2024-07-03 15:25:40 +00:00
|
|
|
const sdk = require('node-appwrite');
|
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
|
|
const client = new sdk.Client()
|
|
|
|
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
2024-08-21 09:16:51 +00:00
|
|
|
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
|
|
|
|
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
2024-07-03 15:25:40 +00:00
|
|
|
|
|
|
|
|
const functions = new sdk.Functions(client);
|
|
|
|
|
|
|
|
|
|
const result = await functions.createDeployment(
|
|
|
|
|
'<FUNCTION_ID>', // functionId
|
|
|
|
|
InputFile.fromPath('/path/to/file', 'filename'), // code
|
|
|
|
|
false, // activate
|
|
|
|
|
'<ENTRYPOINT>', // entrypoint (optional)
|
|
|
|
|
'<COMMANDS>' // commands (optional)
|
|
|
|
|
);
|