0.0.49 ā€¢ Published 21 days ago

@hattip/bundler-deno v0.0.49

Weekly downloads
-
License
MIT
Repository
github
Last release
21 days ago

@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.

0.0.49

21 days ago

0.0.46

5 months ago

0.0.47

3 months ago

0.0.48

3 months ago

0.0.45

8 months ago

0.0.44

9 months ago

0.0.43

9 months ago

0.0.42

10 months ago

0.0.41

10 months ago

0.0.40

10 months ago

0.0.39

10 months ago

0.0.38

11 months ago

0.0.37

11 months ago

0.0.36

11 months ago

0.0.35-canary.2

1 year ago

0.0.35-canary.7

1 year ago

0.0.35-canary

1 year ago

0.0.35

1 year ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.20

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago