Skip to content

v123

Compare
Choose a tag to compare
@ije ije released this 22 May 09:50
· 822 commits to main since this release

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! πŸ¦•

Syntax Highlighter-1

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 in version (close #639)
  • Fix findFiles function (close #638)