geelen
11/19/2021, 10:11 AMGreg Brimble | Cloudflare Pages
11/19/2021, 10:11 AMboojum
11/19/2021, 10:20 AM/corsproxy
segment in the url path. But I think that I got function routing wrong as I'm getting 404. I would appreciate any debugging pointers!ickerio
11/19/2021, 10:54 AMhannes
11/19/2021, 10:55 AMGreg Brimble | Cloudflare Pages
11/19/2021, 10:56 AMGreg Brimble | Cloudflare Pages
11/19/2021, 10:57 AMickerio
11/19/2021, 10:57 AMboojum
11/19/2021, 10:58 AMGreg Brimble | Cloudflare Pages
11/19/2021, 11:01 AMGreg Brimble | Cloudflare Pages
11/19/2021, 11:01 AMboojum
11/19/2021, 11:06 AMPonjimon
11/19/2021, 12:43 PMwrangler@beta
so I run this command: wrangler pages dev -- yarn run ui:dev
which translates to wrangler pages dev -- next
. Running next
just starts the local dev environment of NextJS.
I have a file src/pages/index.tsx
that basically just is a hello world React component and a file functions/index.ts
that again is just a hello world onRequestGet
function. My problem is, that in the console I see it serving at http://127.0.0.1:8788
but when I open that, it just is the API / functions route I created, how do I access the UI (which next by default serves at port 3000) and how can I then make HTTP requests to the API? I've seen some code on GitHub where they use await fetch('/someFunctionRoute')
but I don't really understand how I make that work with NextJSPonjimon
11/19/2021, 1:43 PMkavinplays
11/19/2021, 2:45 PMwonkrattle
11/19/2021, 3:50 PMkavinplays
11/19/2021, 3:52 PMkavinplays
11/19/2021, 3:52 PMwonkrattle
11/19/2021, 3:52 PMwonkrattle
11/19/2021, 3:53 PMwonkrattle
11/19/2021, 3:54 PMkavinplays
11/19/2021, 3:54 PMwonkrattle
11/19/2021, 3:55 PMwonkrattle
11/19/2021, 3:56 PMkavinplays
11/19/2021, 3:57 PMkavinplays
11/19/2021, 3:57 PMkavinplays
11/19/2021, 3:57 PMwonkrattle
11/19/2021, 3:58 PMkavinplays
11/19/2021, 3:59 PMwonkrattle
11/19/2021, 4:01 PM