Back

How to debug/test functions during the development (nodejs)

  • 0
  • Self Hosted
  • Functions
elemin67
9 May, 2023, 11:46

Im creating functions and test it via ececute button on the frontend. Is there a way to test the function before deployment. How I can see the console logs? Im using vscode

TL;DR
The user wants to debug and test a node.js cloud function that runs a command in a Docker container with flutter installed. They cannot make it work on appwrite and want to attach the VSCode debugger to the node.js runtime used by appwrite. They mention that the node.js cloud function code is run inside the appwrite-worker-functions container. The user is looking for a way to test the function before deployment and see the console logs. A suggestion is made to deploy to appwrite and run the function within appwrite for testing. Solution: Deploy the function to appwrite and run it within appwrite for testing.
Drake
9 May, 2023, 16:39

I suggest deploying to appwrite and running it in appwrite to make sure it works as you develop

Drake
9 May, 2023, 16:40

If you really don't want to do that, you can try to spin up an open runtimes container. See https://github.com/open-runtimes/open-runtimes/tree/main/runtimes/node-18.0

Loic Devaux
3 Jul, 2023, 21:45

Hi, I want a nodejs cloud function to run a command (flutter build web) on a docker container with flutter installed on it. I cant make it work on appwrite for now.This feature very much depends on the underlying stack so making it work on another runtime outside appwrite will not help me much. Is there a way to attach vscode debugger to the nodejs runtime used by appwrite so I can debug step by step ( like on the firebase emulator) ? I am supposing that the nodejs cloud function code is run inside the appwrite-worker-functions container, but I might be wrong.

Drake
3 Jul, 2023, 21:52

Please create a new post instead of posting in an old post

Loic Devaux
3 Jul, 2023, 22:06

Okay.

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