-
Notifications
You must be signed in to change notification settings - Fork 13
Added starteers for all node versions #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # 📧 Unnamed function | ||
|
|
||
| <!-- Give your function a name --> | ||
|
|
||
| Welcome to the documentation of this function 👋 We strongly recommend keeping this file in sync with your function's logic to make sure anyone can easily understand your function in the future. If you don't need documentation, you can remove this file. | ||
|
|
||
| ## 🤖 Documentation | ||
|
|
||
| Simple function similar to typical "hello world" example, but instead, we return a simple JSON that tells everyone how awesome developers are. | ||
|
|
||
| <!-- Update with your description, for example 'Create Stripe payment and return payment URL' --> | ||
|
|
||
| _Example input:_ | ||
|
|
||
| No input | ||
|
|
||
| <!-- If input is expected, add example --> | ||
|
|
||
| _Example output:_ | ||
|
|
||
| <!-- Update with your expected output --> | ||
|
|
||
| ```json | ||
| { | ||
| "areDevelopersAwesome": true | ||
| } | ||
| ``` | ||
|
|
||
| ## 📝 Environment Variables | ||
|
|
||
| List of environment variables used by this cloud functions: | ||
|
|
||
| - **APPWRITE_FUNCTION_ENDPOINT** - Endpoint of Appwrite project | ||
| - **APPWRITE_FUNCTION_API_KEY** - Appwrite API Key | ||
| <!-- Add your custom environments variables --> | ||
|
|
||
| ## 🚀 Deployment | ||
|
|
||
| There are two ways of deploying the Appwrite function, both having the same results, but each using a different process. We highly recommend using CLI deployment to achieve the best experience. | ||
|
|
||
| ### Using CLI | ||
|
|
||
| Make sure you have [Appwrite CLI](https://appwrite.io/docs/command-line#installation) installed, and you have successfully logged into your Appwrite server. To make sure AppwriteCLI is ready, you can use the command `appwrite client --debug` and it should respond with green text `✓ Success`. | ||
|
|
||
| Make sure you are in the same folder as your `appwrite.json` file and run `appwrite deploy function` to deploy your function. You will be prompted to select which functions you want to deploy. | ||
|
|
||
| ### Manual using tar.gz | ||
|
|
||
| Manual deployment has no requirements and uses Appwrite Console to deploy the tag. First, enter the folder of your function. Then, create a tarball of the whole folder and gzip it. After creating `.tar.gz` file, visit Appwrite Console, click on the `Deploy Tag` button and switch to the `Manual` tab. There, set the `entrypoint` to `src/index.js`, and upload the file we just generated. Finally, it's considered good practice to remove the build file from your function source folder. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "appwrite-function", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "main": "src/index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "node-appwrite": "^4.0.2" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| const sdk = require('node-appwrite'); | ||
|
|
||
| const client = new sdk.Client(); | ||
|
|
||
| // You can remove services you don't use | ||
| let account = new sdk.Account(client); | ||
| let avatars = new sdk.Avatars(client); | ||
| let database = new sdk.Database(client); | ||
| let functions = new sdk.Functions(client); | ||
| let helath = new sdk.Health(client); | ||
| let locale = new sdk.Locale(client); | ||
| let storage = new sdk.Storage(client); | ||
| let teams = new sdk.Teams(client); | ||
| let users = new sdk.Users(client); | ||
|
|
||
| client | ||
| .setEndpoint(process.env.APPWRITE_FUNCTION_ENDPOINT) | ||
| .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) | ||
| .setKey(process.env.APPWRITE_FUNCTION_API_KEY); | ||
|
|
||
| if(!process.env.APPWRITE_FUNCTION_ENDPOINT || !process.env.APPWRITE_FUNCTION_API_KEY) { | ||
| console.warn("Some environment variables are not set. Function cannot use AppwriteSDK properly."); | ||
Meldiron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /* | ||
| 'req' variable has: | ||
| 'headers' - object with request headers | ||
| 'payload' - object with request body data | ||
| 'env' - object with environment variables | ||
|
|
||
| 'res' variable has: | ||
| 'send(text, status)' - function to return text response. Status code defaults to 200 | ||
| 'json(obj, status)' - function to return JSON response. Status code defaults to 200 | ||
|
|
||
| If an error is thrown, a response with code 500 will be returned. | ||
| */ | ||
|
|
||
| module.exports = function(req, res) { | ||
| res.json({ | ||
| areDevelopersAwesome: true, | ||
| }); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # 📧 Unnamed function | ||
|
|
||
| <!-- Give your function a name --> | ||
|
|
||
| Welcome to the documentation of this function 👋 We strongly recommend keeping this file in sync with your function's logic to make sure anyone can easily understand your function in the future. If you don't need documentation, you can remove this file. | ||
|
|
||
| ## 🤖 Documentation | ||
|
|
||
| Simple function similar to typical "hello world" example, but instead, we return a simple JSON that tells everyone how awesome developers are. | ||
|
|
||
| <!-- Update with your description, for example 'Create Stripe payment and return payment URL' --> | ||
|
|
||
| _Example input:_ | ||
|
|
||
| No input | ||
|
|
||
| <!-- If input is expected, add example --> | ||
|
|
||
| _Example output:_ | ||
|
|
||
| <!-- Update with your expected output --> | ||
|
|
||
| ```json | ||
| { | ||
| "areDevelopersAwesome": true | ||
| } | ||
| ``` | ||
|
|
||
| ## 📝 Environment Variables | ||
|
|
||
| List of environment variables used by this cloud functions: | ||
|
|
||
| - **APPWRITE_FUNCTION_ENDPOINT** - Endpoint of Appwrite project | ||
| - **APPWRITE_FUNCTION_API_KEY** - Appwrite API Key | ||
| <!-- Add your custom environments variables --> | ||
|
|
||
| ## 🚀 Deployment | ||
|
|
||
| There are two ways of deploying the Appwrite function, both having the same results, but each using a different process. We highly recommend using CLI deployment to achieve the best experience. | ||
|
|
||
| ### Using CLI | ||
|
|
||
| Make sure you have [Appwrite CLI](https://appwrite.io/docs/command-line#installation) installed, and you have successfully logged into your Appwrite server. To make sure AppwriteCLI is ready, you can use the command `appwrite client --debug` and it should respond with green text `✓ Success`. | ||
|
|
||
| Make sure you are in the same folder as your `appwrite.json` file and run `appwrite deploy function` to deploy your function. You will be prompted to select which functions you want to deploy. | ||
|
|
||
| ### Manual using tar.gz | ||
|
|
||
| Manual deployment has no requirements and uses Appwrite Console to deploy the tag. First, enter the folder of your function. Then, create a tarball of the whole folder and gzip it. After creating `.tar.gz` file, visit Appwrite Console, click on the `Deploy Tag` button and switch to the `Manual` tab. There, set the `entrypoint` to `src/index.js`, and upload the file we just generated. Finally, it's considered good practice to remove the build file from your function source folder. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "appwrite-function", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "main": "src/index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "node-appwrite": "^4.0.2" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| const sdk = require('node-appwrite'); | ||
|
|
||
| const client = new sdk.Client(); | ||
|
|
||
| // You can remove services you don't use | ||
| let account = new sdk.Account(client); | ||
| let avatars = new sdk.Avatars(client); | ||
| let database = new sdk.Database(client); | ||
| let functions = new sdk.Functions(client); | ||
| let helath = new sdk.Health(client); | ||
| let locale = new sdk.Locale(client); | ||
| let storage = new sdk.Storage(client); | ||
| let teams = new sdk.Teams(client); | ||
| let users = new sdk.Users(client); | ||
|
|
||
| client | ||
| .setEndpoint(process.env.APPWRITE_FUNCTION_ENDPOINT) | ||
| .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) | ||
| .setKey(process.env.APPWRITE_FUNCTION_API_KEY); | ||
|
|
||
| if(!process.env.APPWRITE_FUNCTION_ENDPOINT || !process.env.APPWRITE_FUNCTION_API_KEY) { | ||
| console.warn("Some environment variables are not set. Function cannot use AppwriteSDK properly."); | ||
| } | ||
|
|
||
| /* | ||
| 'req' variable has: | ||
| 'headers' - object with request headers | ||
| 'payload' - object with request body data | ||
| 'env' - object with environment variables | ||
|
|
||
| 'res' variable has: | ||
| 'send(text, status)' - function to return text response. Status code defaults to 200 | ||
| 'json(obj, status)' - function to return JSON response. Status code defaults to 200 | ||
|
|
||
| If an error is thrown, a response with code 500 will be returned. | ||
| */ | ||
|
|
||
| module.exports = function(req, res) { | ||
| res.json({ | ||
| areDevelopersAwesome: true, | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # 📧 Unnamed function | ||
|
|
||
| <!-- Give your function a name --> | ||
|
|
||
| Welcome to the documentation of this function 👋 We strongly recommend keeping this file in sync with your function's logic to make sure anyone can easily understand your function in the future. If you don't need documentation, you can remove this file. | ||
|
|
||
| ## 🤖 Documentation | ||
|
|
||
| Simple function similar to typical "hello world" example, but instead, we return a simple JSON that tells everyone how awesome developers are. | ||
|
|
||
| <!-- Update with your description, for example 'Create Stripe payment and return payment URL' --> | ||
|
|
||
| _Example input:_ | ||
|
|
||
| No input | ||
|
|
||
| <!-- If input is expected, add example --> | ||
|
|
||
| _Example output:_ | ||
|
|
||
| <!-- Update with your expected output --> | ||
|
|
||
| ```json | ||
| { | ||
| "areDevelopersAwesome": true | ||
| } | ||
| ``` | ||
|
|
||
| ## 📝 Environment Variables | ||
|
|
||
| List of environment variables used by this cloud functions: | ||
|
|
||
| - **APPWRITE_FUNCTION_ENDPOINT** - Endpoint of Appwrite project | ||
| - **APPWRITE_FUNCTION_API_KEY** - Appwrite API Key | ||
| <!-- Add your custom environments variables --> | ||
|
|
||
| ## 🚀 Deployment | ||
|
|
||
| There are two ways of deploying the Appwrite function, both having the same results, but each using a different process. We highly recommend using CLI deployment to achieve the best experience. | ||
|
|
||
| ### Using CLI | ||
|
|
||
| Make sure you have [Appwrite CLI](https://appwrite.io/docs/command-line#installation) installed, and you have successfully logged into your Appwrite server. To make sure AppwriteCLI is ready, you can use the command `appwrite client --debug` and it should respond with green text `✓ Success`. | ||
|
|
||
| Make sure you are in the same folder as your `appwrite.json` file and run `appwrite deploy function` to deploy your function. You will be prompted to select which functions you want to deploy. | ||
|
|
||
| ### Manual using tar.gz | ||
|
|
||
| Manual deployment has no requirements and uses Appwrite Console to deploy the tag. First, enter the folder of your function. Then, create a tarball of the whole folder and gzip it. After creating `.tar.gz` file, visit Appwrite Console, click on the `Deploy Tag` button and switch to the `Manual` tab. There, set the `entrypoint` to `src/index.js`, and upload the file we just generated. Finally, it's considered good practice to remove the build file from your function source folder. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "appwrite-function", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "main": "src/index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "node-appwrite": "^4.0.2" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| const sdk = require('node-appwrite'); | ||
|
|
||
| const client = new sdk.Client(); | ||
|
|
||
| // You can remove services you don't use | ||
| let account = new sdk.Account(client); | ||
| let avatars = new sdk.Avatars(client); | ||
| let database = new sdk.Database(client); | ||
| let functions = new sdk.Functions(client); | ||
| let helath = new sdk.Health(client); | ||
| let locale = new sdk.Locale(client); | ||
| let storage = new sdk.Storage(client); | ||
| let teams = new sdk.Teams(client); | ||
| let users = new sdk.Users(client); | ||
|
|
||
| client | ||
| .setEndpoint(process.env.APPWRITE_FUNCTION_ENDPOINT) | ||
| .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) | ||
| .setKey(process.env.APPWRITE_FUNCTION_API_KEY); | ||
|
|
||
| if(!process.env.APPWRITE_FUNCTION_ENDPOINT || !process.env.APPWRITE_FUNCTION_API_KEY) { | ||
| console.warn("Some environment variables are not set. Function cannot use AppwriteSDK properly."); | ||
| } | ||
|
|
||
| /* | ||
| 'req' variable has: | ||
| 'headers' - object with request headers | ||
| 'payload' - object with request body data | ||
| 'env' - object with environment variables | ||
|
|
||
| 'res' variable has: | ||
| 'send(text, status)' - function to return text response. Status code defaults to 200 | ||
| 'json(obj, status)' - function to return JSON response. Status code defaults to 200 | ||
|
|
||
| If an error is thrown, a response with code 500 will be returned. | ||
| */ | ||
|
|
||
| module.exports = function(req, res) { | ||
| res.json({ | ||
| areDevelopersAwesome: true, | ||
| }); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.