@hattip/bundler-deno v0.0.49
@hattip/bundler-deno
Hattip bundler for Deno. It uses esbuild
behind the scenes.
CLI
hattip-deno <input> <output>
Bundle the Hattip app in <input> into <output> as a Deno module.
Options:
-h, --help Display this message
-v, --version Display version number
The input should be a Deno module similar to the following:
import { createRequestHandler } from "@hattip/adapter-deno";
import handler from "./handler.js";
Deno.serve(createRequestHandler(handler), { port: 3000 });
If you want serve static files too, you can use the serveDir
function. Assuming your static files are in the public
directory, you can use the following:
import { serve, serveDir, createRequestHandler } from "@hattip/adapter-deno";
import hattipHandler from "./handler.js";
const handler = createRequestHandler(hattipHandler);
serve(
async (request, connInfo) => {
const staticResponse = await serveDir(request, { fsRoot: "./public" });
if (staticResponse.status !== 404) {
return staticResponse;
}
return handler(request, connInfo);
},
{
port: 3000,
},
);
The output is a Deno module that can be run with deno run
or deployed to Deno Deploy.
JavaScript API
š§ TODO š§
Refer to the TypeScript for the time being.
2 months ago
6 months ago
4 months ago
4 months ago
9 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago