Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pomdtr/deno-embed
https://github.com/pomdtr/deno-embed
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pomdtr/deno-embed
- Owner: pomdtr
- Created: 2024-07-12T13:59:55.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T12:32:19.000Z (5 months ago)
- Last Synced: 2024-07-27T13:06:34.121Z (5 months ago)
- Language: TypeScript
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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