stevekrouse-blob_admin.web.val.run
Readme

Blob Admin

This is a lightweight Blob Admin interface to view and debug your Blob data.

b7321ca2cd80899250589b9aa08bc3cae9c7cea276282561194e7fc537259b46.png

Use this button to install the val:

It uses basic authentication with your Val Town API Token as the password (leave the username field blank).

TODO

  • /new - render a page to write a new blob key and value
  • /edit/:blob - render a page to edit a blob (prefilled with the existing content)
  • /delete/:blob - delete a blob and render success
  • add upload/download buttons
  • Use modals for create/upload/edit/view/delete page (htmx ?)
  • handle non-textual blobs properly
  • use codemirror instead of a textarea for editing text blobs
1
2
3
4
5
6
7
8
9
10
11
12
import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth";
import { blob_admin_blob } from "https://esm.town/v/stevekrouse/blob_admin_blob";
import { blob_admin_home } from "https://esm.town/v/stevekrouse/blob_admin_home";
import { Hono } from "npm:hono@3.9.2";
const app = new Hono();
app.get("/", async (c) => c.html(await blob_admin_home()));
app.get("/new", (c) => c.html("TODO: New Blob"));
app.get("/:blob", async (c) => c.html(await blob_admin_blob(c.req.param("blob"))));
app.get("/edit/:blob", async (c) => c.html(`TODO: Edit ${c.req.param("blob")}`));
app.get("/delete/:blob", async (c) => c.html(`TODO: Delete ${c.req.param("blob")}`));
export default basicAuth(app.fetch);
Only the latest version can be previewed
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
4
pomdtr avatar

Instead of instructing the user to fork the val, why not suggest the user to create a new val referencing your own ?

export { default } from "https://esm.town/v/stevekrouse/blob_admin";

It would allow the user to automatically get update from your, or control them using the version query param.

stevekrouse avatar

Excellent idea! That's how @rodrigotello/hnFollow works.

This way is slightly easier to customize, that way is slightly easier to manage updates.

In theory, Val Town could help users manage forks like Github does:

Screenshot 2023-12-14 at 09.28.40.png

Or even notify users that they should "pull" from the remote val because it has new changes.

The question of when to use something as a dependency vs as a fork is a fascinating one. I'm eager to see what patterns emerge

pomdtr avatar

I see importing as an installation method a val to my val.town account, while forking is just copying a specific version of a val.

I can see myself using, it depends as if I see myself as a user or a contributor.

Even for the same val, I can see myself having my prod endpoint and my dev endpoint.

pomdtr avatar

comments really need an edit button 😅

v9
April 25, 2024