Looking at the linked tutorial, it

Looking at the linked tutorial, it appears that Solid uses SSR. If that is the case, then you need to create that route through whatever mechanism solid provides, rather than the /functions folder
5 Replies
meakr
meakr5mo ago
Thanks @HardlyWorkin' Do you know what tells workerd (I think workerd?) that this is SSR and to ignore /functions? Or it it just that my app responds at those endpoints at all and therefore it ignores any /function-defined routes by default? (but wouldn't a non-SSR frontend app still respond on those 🤔)
Hello, I’m Allie!
The way most frameworks do SSR is by generating a _worker.js file(Advanced Mode).
When using a _worker.js file, the entire /functions directory is ignored, including its routing and middleware characteristics. Instead, the _worker.js file is deployed and must be written using the Module Worker syntax.
Some frameworks do allow you to switch them over to dumping a /functions/[[path]].js file, which does allow you to use the /functions folder as normal, though I would say it is cleaner to define API Routes via the framework-specified way instead.
meakr
meakr5mo ago
Yeah fwiw, I think I'll stick to the framework idioms, I was just wondering how the sausage is made 🙂
Hello, I’m Allie!
Note too that Advanced Mode can also be used even if not using an SSR Framework, if you want to bring-your-own-router/want to bundle your Functions yourself.
meakr
meakr5mo ago
Noted - thanks! I think this is what I was missing in my mental model https://nitro.unjs.io/deploy/providers/cloudflare Solid was using this under the hood (via app.config.ts) to generate _routes.js and _worker.js files, and that's where the routing magic was happening (☝🏻 mostly noting for any future people with a similar issue)
Want results from more Discord servers?
Add your server