Back

whats the easiest way to write and test functions?

  • 0
  • Web
Shoxious
26 Nov, 2023, 21:51

i am trying to write the first cloud functions in python or js. what is the easiest way and how can i test this locally? unfortunately i can't find anything on the appwrite page

TL;DR
User is looking for the easiest way to write and test functions. They are experiencing issues installing the Appwrite CLI. They receive an error message related to a 'str' object. They are also looking for guidance on how to upload a Python file to the Appwrite folder. They would like to know the easiest way to write cloud functions and how to test them locally. Solution: - It seems that the installation URL provided is invalid. It is suggested to install the Appwrite CLI using NPM instead. - The error message regarding the 'str' object attribute is likely a coding issue that needs to be debugged. - To upload
Shoxious
26 Nov, 2023, 23:13

And how can i upload the python main.py in the appwrite folder?

Shoxious
26 Nov, 2023, 23:19

Traceback (most recent call last): File "C:\Users\Michael\AppData\Roaming\JetBrains\IntelliJIdea2023.1\plugins\python\helpers\pydev\pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "C:\Users\Michael\AppData\Roaming\JetBrains\IntelliJIdea2023.1\plugins\python\helpers\pydevpydev_impspydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:\Users\Michael\IdeaProjects\brawl_stars\appwrite-functions\deploy_function.py", line 15, in <module> result = functions.create_deployment('6563f3a89b7ebefcb300', 'main.py', InputFile.from_path('fetch-data/main.py'), True) File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\appwrite\services\functions.py", line 186, in create_deployment return self.client.chunked_upload(api_path, { File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\appwrite\client.py", line 129, in chunked_upload if input_file.source_type == 'path': AttributeError: 'str' object has no attribute 'source_type'

Drake
26 Nov, 2023, 23:35

I use the Appwrite CLI and deploy to a local/dev instance of Appwrite

Shoxious
27 Nov, 2023, 12:12

ok that sounds nice. but this url iwr -useb https://appwrite.io/cli/install.ps1 is invalid

Drake
27 Nov, 2023, 22:20

Ya, installing that way doesn't quite work at the moment. I suggest installing using NPM

Shoxious
28 Nov, 2023, 08:58

when i install it over npm it will work in the powershell? ^^

Drake
3 Dec, 2023, 00:38

I believe so

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more