TravisFrank
03/10/2022, 5:53 PMWalshy | Pages
03/10/2022, 5:55 PMWalshy | Pages
03/10/2022, 5:55 PMvivekpatt_whyd
03/10/2022, 5:56 PMKing Mesal
03/10/2022, 6:50 PMfunctions/api/blog/[category]/[id].ts
When I launch it and I request the path /api/blog/cat/123456
category: cat,123456
id: undefined
Now, if I change the functions path to be [[category]]
instead of single bracket, it works and breaks the path apart as I would hope.Skye
03/10/2022, 6:52 PMSkye
03/10/2022, 6:53 PM/api/blog/:category]/[id
King Mesal
03/10/2022, 6:54 PMvivekpatt_whyd
03/10/2022, 6:56 PMminimusubi
03/10/2022, 7:05 PMminimusubi
03/10/2022, 7:06 PMminimusubi
03/10/2022, 7:07 PMvivekpatt_whyd
03/10/2022, 8:19 PMKing Mesal
03/10/2022, 9:19 PMKing Mesal
03/10/2022, 9:34 PM"@cloudflare/workers-types": "^3.4.0"
Of course I try import { EventContext } from "@cloudflare/workers-types";
I also did import type, but same error, "is not a module"
Has anyone does this? am I missing something super obvious?Artis3n
03/10/2022, 10:16 PMonRequestPost()
function set up and I'm logging the full context I receive. I don't see the POST body parameters anywhere. Shouldn't they be under context.request.body
? I POST an object containing the fields "page" and "token" and context.request.body
is the object { locked: false }
Any logs I can collect to help identify what is going on? POSTing like this from a Nuxt site:
await $axios.$post('/api/checkToken', { page: 1, token: 'abc123' })
kian
03/10/2022, 10:21 PMconst foo = await request.json()
King Mesal
03/10/2022, 11:04 PM"types": [
"@cloudflare/workers-types",
]
you can reference this context as such
context: EventContext<Event, string, any>
Artis3n
03/10/2022, 11:14 PMsudo killall windows
03/11/2022, 1:34 AMIsaac McFadyen | YYZ01
03/11/2022, 1:35 AMsudo killall windows
03/11/2022, 1:35 AMsudo killall windows
03/11/2022, 1:36 AMsudo killall windows
03/11/2022, 1:38 AMsudo killall windows
03/11/2022, 1:41 AMJames
03/11/2022, 1:41 AMIsaac McFadyen | YYZ01
03/11/2022, 1:42 AMwrangler2
has local-only emulation for Functions rn.sudo killall windows
03/11/2022, 1:44 AMsudo killall windows
03/11/2022, 1:44 AM