v123
In v123, we added a server module for Deno runtime that allows you to serve esm.sh locally with command deno run -A https://esm.sh/server
, zero config and no code need! π¦
Or build your deno app with esm.sh server:
// server.js
import { serve } from "https://esm.sh/v123/server";
β
serve((req) => {
const url = new URL(req.url);
β
// your routes override esm.sh routes
if (url.pathname === "/") {
// using a custom homepage
return new Response("<h1>Welcome to use esm.sh!</h1>", {
headers: { "Content-Type": "text/html" },
});
}
});
// $ deno run -A -r server.js
Warning: currently the server doesn't work with Deno Deploy, we are working on it.
Changelog:
- Add
/server
endpoint for Deno to serve esm.sh locally - Add scope to config (#636 by @johnpangalos)
- Fix
.d.ts
walker (close #640) - Fix packages with
v
prefix inversion
(close #639) - Fix
findFiles
function (close #638)