Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pomdtr/deno-embed


https://github.com/pomdtr/deno-embed

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Smallweb Embed

This package provide a simple way to embed assets in your smallweb application.

## Usage

Use the cli to embed assets in your app:

```sh
deno run -A jsr:@smallweb/embed frontend/dist dist
```

Then, from your app, you can import the assets from the generated module:

```ts
import embeds from "./dist/mod.ts";

// serve the static assets from the frontend/dist directory
function handler(req: Request) {
return embeds.serve(req);
}

export default {
fetch: handler,
}
```

## TODO

- ETag support