richardcooke
02/10/2022, 12:50 PMgeelen
02/10/2022, 12:54 PMrichardcooke
02/10/2022, 12:57 PMKim
02/10/2022, 1:34 PMjs
/** @type {import('@sveltejs/kit').RequestHandler} */
export async function get({ params }) {
// `params.id` comes from [id].js
const item = await db.get(params.id);
if (item) {
return {
body: { item }
};
}
return {
status: 404
};
}
Rubidot
02/10/2022, 7:21 PMErwin
02/10/2022, 8:28 PMLarry
02/10/2022, 9:08 PMwrangler pages dev
? I know you can bind DOs when you launch wrangler pages dev
and I'm guessing that the state is actually stored in memory locally, but the actual code for the DO class comes from the code you've previously deployed. I'm hoping for an experience like ./functions
folder which gets automatically "compiled" and served up locally. Maybe stuff in the ./durable_objects
folder is similarly automagically handled. If not, is there some other way or are we stuck publishing our DO even before we can use it locally? When I look at the miniflare docs which wrangler pages dev
is wrapping, it looks like it's possible either via the JS API or maybe even with the script
field in the wrangler.toml file. I'd rather not use miniflare directly if it can be helped but I'm ready to start exploring that if nobody else knows how to do it with wrangler directly.Erwin
02/10/2022, 9:10 PMkmiyashiro
02/11/2022, 1:00 AMIsaac McFadyen | YYZ01
02/11/2022, 1:20 AMkmiyashiro
02/11/2022, 1:22 AMkmiyashiro
02/11/2022, 1:22 AMkmiyashiro
02/11/2022, 1:22 AMIsaac McFadyen | YYZ01
02/11/2022, 1:23 AMIsaac McFadyen | YYZ01
02/11/2022, 1:26 AM@sveltejs/adapter-static
then it wouldn't use Functions and you wouldn't hit that limit, but then you would have to prerender everything in advance (all loader
functions or endpoints
are called once on build).kmiyashiro
02/11/2022, 3:50 AMkmiyashiro
02/11/2022, 3:50 AMErwin
02/11/2022, 4:44 AMHardAtWork
02/11/2022, 5:05 AMErwin
02/11/2022, 5:13 AMJustinNoel
02/11/2022, 6:24 AMLarry
02/11/2022, 5:45 PMTrash Panda
02/11/2022, 7:26 PMErwin
02/12/2022, 12:02 AMenv.ASSETS.fetch(request)
!!!chup
02/12/2022, 4:57 AM<meta>
tags to your webpages?!!!chup
02/12/2022, 4:58 AMErwin
02/12/2022, 6:50 AMCоlе
02/12/2022, 10:50 PMhttp:
it redirects all POST
requests to GET
, but not if you're using https:
.Cоlе
02/12/2022, 10:51 PMErwin
02/13/2022, 3:10 AM