How to implement Workers in my already existing Vite + React project?
HI there. I have a static site already been made in Cloudflare Pages. But I need to implement Workers within the site / project.
I have looked around and there doesnt seem to be a solution.
If you need to look how my project is structured, I can provide a link to my Github repo.
Thank you in advance.
6 Replies
What are you trying to do?
Serve API requests? Transform a pre-existing page?
To serve api requests yes.
Or does this all have to be done through Functions?
For an example. fetching the worker and do job that way?
A Function is a stripped-down Worker, so a lot of tasks that you can do on Workers should be doable in Functions
Might be a stupid question: Importing my code into said Function will work then?
It should, as long as you follow the correct format
Ok, thank you for the replies.
I'll give it a go. ❤️