Cоlе
01/05/2022, 8:36 PMLucasW
01/05/2022, 11:15 PMLucasW
01/05/2022, 11:15 PMJosh
01/05/2022, 11:21 PMJosh
01/05/2022, 11:21 PMLucasW
01/05/2022, 11:22 PMCоlе
01/05/2022, 11:31 PM_headers
file? I tried putting it in the root and /functions
but no dice.
/*
Access-Control-Allow-Origin: *
Cоlе
01/05/2022, 11:32 PMGreg Brimble | Cloudflare Pages
01/05/2022, 11:47 PMCоlе
01/05/2022, 11:56 PMLeander
01/06/2022, 5:13 AMCоlе
01/06/2022, 5:17 AM_headers
three times, then decided that maybe it was time to take a breakCоlе
01/06/2022, 5:17 AMLeander
01/06/2022, 5:18 AMCоlе
01/06/2022, 5:19 AMts
let headers = { 'content-type': 'application/json;charset=utf8', "Access-Control-Allow-Origin": "*" };
return new Response(body, { headers, status });
Cоlе
01/06/2022, 5:21 AMconst res = await next()
then does the above to it ^martior
01/06/2022, 6:10 PMnpx wrangler pages dev -- npm start
to serve a tailwind react-app and I open port 8788 in the browser wrangler crashes with "TypeError: Web Socket request did not return status 101 Switching Protocols response with Web Socket" I can serve the function on :8788/api and also static assets from react and the react app works as normal on port :3000Jaren
01/07/2022, 3:26 PM/profile/:whatever
endpoints to /profile/[profile].html
(generated by next.js), but i'm getting an http error 406 with this code. I've tried changing the pathname to /profiles/[profile].html
, but that just caused a redirect loop back to /profiles/[profile]
PReimers
01/07/2022, 3:56 PMconfig.json
for some basic configuration parameter in the frontend.
Is it possible to use this file in a function too (using an require
or import
statement)?rkusa
01/07/2022, 4:17 PMts
import config from "../config.json";
and "resolveJsonModule": true
in your tsconfig.json
(if you use TS) should be all that's necessaryPReimers
01/07/2022, 4:17 PMPReimers
01/07/2022, 4:18 PMrkusa
01/07/2022, 4:23 PM/profile/[profile]/index.html
(and not a /profile/[profile].html
)? If so, the following might work:
ts
env.ASSETS.fetch(
new Request(
new URL("/profile/[profile]/", request.url).toString(),
request
)
)
The trailing /
was important IIRC. Also, your message has a mix of singular and plural `profile`/`profiles` - which could also the underlying issue.sandeepsihari
01/07/2022, 7:28 PMCоlе
01/07/2022, 7:41 PMJaren
01/08/2022, 3:03 AMJaren
01/08/2022, 3:03 AMCоlе
01/08/2022, 3:25 AM[pages:err] SyntaxError: Unexpected reserved word
in wrangler. Is cache not supported?steranevdy
01/08/2022, 4:27 AM