Back

Cloud Function as Sever

  • 0
  • Self Hosted
  • Functions
dammy
19 Jun, 2023, 07:45

can I make a cloud function always run like a server? there is a need to always listen to an API asynchronously

TL;DR
User is asking for help with setting up a webhook for Paystack to update a code when a user's account is funded successfully. They want a code that can consistently run and listen to an API. There is a suggestion to use a webhook and handle the data on the client-side app. The user wants the cloud function to always run asynchronously and listen to an API. There are links provided for additional information. Solution: It is suggested to use a webhook to send data to a URL on the client-side app and handle it there. There is no specific solution provided for running the cloud function consistently.
dammy
19 Jun, 2023, 09:00

@safwan

safwan
19 Jun, 2023, 09:01

do you want to make the function act as an API, or do you want to listen to an API from the function?

dammy
19 Jun, 2023, 17:08

listen to an API from the function @safwan

dammy
22 Jun, 2023, 14:32

Hello @safwan

Drake
22 Jun, 2023, 17:06

can you clarify/provide more details?

dammy
23 Jun, 2023, 07:33

I want my cloud function to always run asynchronously so it can listen to an API @Steven @safwan

safwan
23 Jun, 2023, 08:27

please describe what exactly you want to do. and why are you using cloud functions for this?

dammy
23 Jun, 2023, 09:17

I want the function to listen to an API when user payment is successful and return a response @safwan

safwan
23 Jun, 2023, 10:01

isn't a webhook a better approach for this?

safwan
23 Jun, 2023, 10:02

you can setup a webhook that send the data to a URL on your client-side app, and handle it there

dammy
23 Jun, 2023, 11:33

okay, any example? @safwan

Drake
23 Jun, 2023, 14:56

like a stripe webhook? what's the network flow look like?

dammy
23 Jun, 2023, 15:21

paystack specifically, users have dedicated numbers that is used for funding account in order to buy services, if funding is successful, I want to always have a code that updates tat, how do I do that with cloud function since the code must be live consistently?

Drake
23 Jun, 2023, 16:03

typically, these platforms allow you to set up a webhook so that whenever some update occurs, a POST request is made to that webhook URL. is that what paystack has?

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