cloudflare-docs
cloudflare-docs copied to clipboard
Ambiguious / not clear where to put the _routes.json file
Existing documentation URL(s)
- https://developers.cloudflare.com/pages/functions/routing/
What changes are you suggesting?
Create a _routes.json file to control when your Function is invoked. It should be placed in the output directory of your project.
I found the solution from the dashboard but maybe it should specify the directory explicitly as it is ambiguous what the 'output directory is' is it the root or the public folder or the functions folder I didn't know and put it in the root of the project so it was being ignored.
Invocation routes determine when your Functions script is executed. This file is generated based on the files present in the /functions directory.
(from function section of pages project)