How to use worker with an existing application
I currently have a react code base and i want to deploy i to Cloudflare worker. Can someone refere me on how to augment existing application.
12 Replies
Is the React app static?
No not static
What are you using for the server? Next.js?
Am uisng Vike app like Next.js
Vike provides an example here: https://github.com/vikejs/vike/tree/main/examples/cloudflare-workers-react/
GitHub
vike/examples/cloudflare-workers-react at main · vikejs/vike
🔨 Like Next.js / Nuxt but as do-one-thing-do-it-well Vite plugin. - vikejs/vike
Should be as simple as or something
Have looked out this example, It is an app created form gound up with worker. My case is this, I have already worked on an app on Vike and i want to deploy it to woker.
How do i go about doing this? Not provided i their example
Do you have a repo for it?
GitHub
GitHub - lamodots/vike-app: play ground
play ground. Contribute to lamodots/vike-app development by creating an account on GitHub.
Did you take a looke at it?
Ok, so looking at it, I'm not actually sure how to adapt it. Tbh, I've never used Vike myself. Maybe try starting with their example that works, and slowly copy over components/pages?
Big thing though, don't use
node-fetch
, since Workers already has the fetch
APIAlight