Hmm interesting! So I have refactored my code and created two utility modules inside of the /funct
Hmm interesting!
So I have refactored my code and created two utility modules inside of the /functions directory:
I have also tested if there was any routes deployed in dev mode using npx wrangler pages dev out/ for the utility modules in /functions & am getting 404 errors for both but I'm not sure if this will replicate to prod
I did a search in this discord regarding 'utility functions' and seem to have found one screenshot discussing a similar problem, but I couldn't find any solid citations in the docs so I thought to double check here
So in general, is the correct way to handle utilities and helper methods in the /functions dir to define them outside of the /functions dir and import them in?
Or do we just trust that wrangler will appropriately deal with any code in the /functions dir that doesn't export onRequest?
So I have refactored my code and created two utility modules inside of the /functions directory:
- One for mailing functionality
- One for google oauth token fetching
I have also tested if there was any routes deployed in dev mode using npx wrangler pages dev out/ for the utility modules in /functions & am getting 404 errors for both but I'm not sure if this will replicate to prod
I did a search in this discord regarding 'utility functions' and seem to have found one screenshot discussing a similar problem, but I couldn't find any solid citations in the docs so I thought to double check here
So in general, is the correct way to handle utilities and helper methods in the /functions dir to define them outside of the /functions dir and import them in?
Or do we just trust that wrangler will appropriately deal with any code in the /functions dir that doesn't export onRequest?






