Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
import { nodeJS_dist } from "https://esm.town/v/stevekrouse/nodeJS_dist";
import LZString from "npm:lz-string";
export async function nodeJSDist(req: Request): Promise<Response> {
let url = new URL(req.url);
if (url.pathname === "/index.tab") {
return new Response(LZString.decompress(nodeJS_dist));
} else if (url.pathname === "/index.json") {
return new Response("Coming soon...");
} else {
return new Response("Not found", { status: 404 });
}
}
stevekrouse-nodejsdist.web.val.run
October 25, 2023