Hi guys, I’m trying to set up my site with Cloudflare Pages and Functions. First, I followed this gu

Hi guys, I’m trying to set up my site with Cloudflare Pages and Functions. First, I followed this guide - https://developers.cloudflare.com/pages/framework-guides/nextjs/ssr/get-started/
  • and succeeded to run locally. Then, I wanted to create a simple API served by a Worker, so I followed this guide - https://developers.cloudflare.com/pages/functions/get-started/ . But for some reason, my
    functions
    folder always got ignored. I tried putting it at same level as
    package.json
    , under
    src
    , under src/app, nothing worked. The build output (.vercel/output/) doesn’t contain my function. When I run the website locally and try to call my API localhost:8788/api/helloworld, I only see 404 Error. Do I need to declare anything in
    wrangler.toml
    or change my build command (currently it is like in the first guide) for my
    functions
    folder to work? Thanks in advance!
Cloudflare Docs
Deploy a full-stack Next.js app to Cloudflare Pages
Cloudflare Docs
This guide will instruct you on creating and deploying a Pages Function.
Was this page helpful?