Carlos
CDCloudflare Developers
•Created by Carlos on 11/8/2024 in #workers-help
Webhooks, Websocket, SMTP and Drums, Push API with Workers
Well, I'm quite new to workers in general. I've managed to do what I originally planned so this is just me wanting to learn/try new stuff.
Ok #1 is: I'm using Contentful which allows me to add Webhooks so I did. It makes a POST request to an specified URL, the worker gets the post request, formats the data and for now, just puts it in console.log. So in short, I make an entry in Contentful, Webhook, Workers gets it
Here's the question, how can I make the backend interact with the frontend when a new request has been received? So when a new entry is made, the end result is, just for now, a console.log on the actual frontend (I can handle the rest, it's just the connection between both)
For number #2: Websockets, I learned about them recently and has been researching for God knows how long. I read that it would allow me to achieve #1 however, I'm not knowledgeable about Next.js or any of those frameworks. If you could guide to the right direction, that would be appreciated
Here's number, #3: I have a form, form is submitted, workers receive that form, worker formats said data, then data gets sent to D1 SQL Database
That's good and all. What I want to do, I just want to personally receive an email, like to my gmail account for example, with the data in those forms just as it was sent to the database. It's only to one email account, mine, for notifications
Last but not least, #4: Push API, my worst nightmare. I believe I know how to use the Notification API to accept or decline notifications and I believe I can figure out the rest. However... how would I implement the Push API so for example, back to #1 and #2, when a webhook is sent, a Push notification is sent (Don't know how else to call it) - Also read that websocks is required for this...
Long story short for the 4 of them:
Add console.log on frontend when a POST is sent to the backend from a webhook
Websockets? Huh?
Form submissions, Gets email to personal account
Send notifications
2 replies