Isaac McFadyen | YYZ01
02/26/2022, 6:21 PMJustinNoel
02/26/2022, 11:04 PM
is replaced by ~~~~
. Then, in your code, replace a string of 4 tilde's with a space?RaifY
02/27/2022, 2:42 PMLarry
02/27/2022, 6:08 PMcy.request()
which allows you to hit the endpoint directly and observe the results. I'm sure it'll work the same with any other testing framework that allows you to hit endpoints. What do you normally use to test APIs?Taco Milkshake
02/28/2022, 12:20 AMnpx wrangler pages dev build --kv MY_NAMESPACE
export async function onRequest({ env }) {
const value = await env.MY_NAMESPACE.get('mykey')
return new Response(value)
}
Taco Milkshake
02/28/2022, 12:21 AMTaco Milkshake
02/28/2022, 12:39 AMTaco Milkshake
02/28/2022, 12:39 AMTaco Milkshake
02/28/2022, 12:44 AMTaco Milkshake
02/28/2022, 12:45 AMHardAtWork
02/28/2022, 2:22 AMIsaac McFadyen | YYZ01
02/28/2022, 2:22 AM--local false
.wrangler
for now.minimusubi
02/28/2022, 10:59 AM/api/time => ./functions/api/time.ts
/api/todos => ./functions/api/todos/index.ts
/api/todos/* => ./functions/api/todos/[id].ts
/api/todos/*/** => ./functions/api/todos/[[path]].ts
/*/profile => ./functions/api/[username]/profile.ts
/** => ./functions/api/[[path]].ts
Are the last two lines incorrect? Should they instead read
/api/*/profile => ./functions/api/[username]/profile.ts
/api/** => ./functions/api/[[path]].ts
Taco Milkshake
02/28/2022, 6:01 PMOnly local mode is supported at the moment.
Isaac McFadyen | YYZ01
02/28/2022, 6:01 PMwrangler
.Deleted User
02/28/2022, 6:54 PMPagesFunction<{
IMAGES: KVNamespace;
DOWNLOAD_COUNTER: DurableObjectNamespace;
}>
return type? Is that object notation in the generic type indicating the types within env
in use?Isaac McFadyen | YYZ01
02/28/2022, 6:55 PMenv
, and their type so that Typescript knows, when you enter env.IMAGES
for example, that it's a KV namespace.Deleted User
02/28/2022, 6:56 PMenv
is present within context
(right?) so does that type have any bearing on other elements of the context?Deleted User
02/28/2022, 6:56 PMrequest.cf
Deleted User
02/28/2022, 6:56 PMIsaac McFadyen | YYZ01
02/28/2022, 6:59 PMenv
is inside context
with Pages Functions. So the other parts of the Function are included inside the PagesFunction type, since the user can't change them.Isaac McFadyen | YYZ01
02/28/2022, 6:59 PMrequest.cf
, yeah.Isaac McFadyen | YYZ01
02/28/2022, 6:59 PMwaitUntil
.Deleted User
02/28/2022, 7:00 PMDeleted User
02/28/2022, 7:00 PMIsaac McFadyen | YYZ01
02/28/2022, 7:00 PMDurable Objects
, Environment Variables
, and KV Namespaces
, plus something in Beta I think, so that's the part that's variable).Deleted User
02/28/2022, 7:02 PMNoel Jacob
02/28/2022, 7:23 PMDeleted User
02/28/2022, 7:26 PMfetcher
do?balage
02/28/2022, 7:37 PM