This release is 1 version behind 0.23.0 — the latest version of @http/host-deno-deploy. Jump to latest
@http/host-deno-deploy@0.21.0Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
Hosting on Deno Deploy, for production/staging deployments.
This package works with Deno
JSR Score
94%
Published
3 months ago (0.21.0)
Helpers for hosting on Deno Deploy
Handy helper functions for initializing a server in Deno Deploy.
import init from "@http/host-deno-deploy/init"; import handler from "./handler.ts"; await Deno.serve(init(handler)).finished;
It's a pretty simple function that provides some out of the box conveniences:
- Add logging.
- Register interceptors passed as the remaining parameters after the handler.
- Provides a fallback response (404 Not Found), if the handler 'skips' (ie.
returns
null
), as is the convention in@http
routing functions (eg.cascade
).
denoDeployEtag()
This can be used to generate a constant ETag based on the DENO_DEPLOYMENT_ID
if set, and passed into etagDefault
of the file server functions to restore
the original behaviour of the @std/http/file-server
.
import { staticRoute } from "@http/route/static-route"; import { denoDeployEtag } from "@http/host-deno-deploy/deno-deploy-etag"; import { withFallback } from "@http/route/with-fallback"; Deno.serve( withFallback( staticRoute("/", import.meta.resolve("./public"), { etagDefault: denoDeployEtag(), }), ), );
Built and signed on
View transparency logGitHub Actions