Max
Deno package management questions.
I have a few questions regarding package management in Deno.
1. Here Deno documentation states that import maps are only applied to applications, and that library authors should prefer the deps.ts pattern.
Contrarily, the jsr documentation specifies that a dependency manifest like the import map in the deno.json file can be used by a library. Does this mean that the deps.ts pattern is now obsolete?
2. How do I use packages published with jsr in a browser environment? Using esm.sh, I can do
import ... from "https://esm.sh/preact@10.21.0"
. Can I do the same with jsr?
3. In jsr, all entry points have to be specified explicitly, so we no longer need to add a package with a trailing slash in the import map to import modules beyond the default entry point. Is this correct?
4. How do I replicate a configuration like this in jsr, specifically specifying external dependencies and aliases?
3 replies
Custom `401 Unauthorized` error page, similar to builtin `404 Not Found`?
How can I create a custom error page that is rendered by middleware in Fresh? The middleware handles authentication for incoming requests and if a request fails authentication, the middleware should generate a 401 Unauthorized response that includes the body of the custom error page.
2 replies