How to deploy functions with Pages?

I am working on my 1st CF website and everything works fine on static files, except the /functions directory is not deployed for some reason.

When I check the deployment logs on cloudflare dashboard, connected with Github. It says the /functions directory found but no routes found.

✘ [ERROR] No routes found when building Functions directory: /opt/buildhome/repo/functions
Warning: Wrangler did not find routes when building functions. Skipping.


Does that mean, I need to add a _routes.json to list all the routes?



I was in impression that CF will auto-detect and create routes based on the directory/folder/file.

Any help will be really appreciated.
Was this page helpful?