Back to packages list
Vals using hono
Description from the NPM package:
Web framework built on Web Standards
ssr_router
@pomdtr
HTTP (deprecated)
SSR Framework for val.town Usage The router map url paths to component vals. Component vals must export a React Component as their default export: export default function() {
<h1>Hello World!</h1>
} Optionally, you can define an handler next to your component, allowing you to handle query params or form inputs. Use the ctx.render function to pass props to your component. export const handler: Handler = (ctx) => {
const url = new URL(ctx.req.url);
const params = new URLSearchParams(url.search);
return ctx.render({ name: params.get("name") });
};
export default function(props: {name?: string}) {
<h1>Hello { name || "World }!</h1>
}
sqliteExplorerApp
@nbbaier
HTTP (deprecated)
SQLite Explorer View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal . This is now more an SPA, with tables, queries and results showing up on the same page. Install Install the latest stable version (v86) by forking this val: Authentication Login to your SQLite Explorer with password authentication with your Val Town API Token as the password. Todos / Plans [ ] improve error handling [ ] improve table formatting [ ] sticky table headers [x] add codemirror [ ] add loading indication to the run button (initial version shipped) [ ] add ability to favorite queries [ ] add saving of last query run for a table (started) [ ] add visible output for non-query statements [ ] add schema viewing [ ] add refresh to table list sidebar after CREATE/DROP/ALTER statements [ ] add automatic execution of initial select query on double click [x] add views to the sidebar [ ] add triggers to sidebar [ ] add upload from SQL, CSV and JSON [ ] add ability to connect to a non-val town Turso database [x] fix wonky sidebar separator height problem (thanks to @stevekrouse) [x] make result tables scrollable [x] add export to CSV, and JSON (CSV and JSON helper functions written in this val . Thanks to @pomdtr for merging the initial version!) [x] add listener for cmd+enter to submit query
static
@pomdtr
HTTP (deprecated)
Static Vals Serve static content from val.town Usage First, fork this val to get your own http endpoint. Then create a val that uses a string as it's default export, or a single string export. The val must be either public or unlisted . export default `<static content>` You can then fetch the exported string from outside val.town using: curl 'https://<owner>-static.web.val.run/<val>.<extension>' The Content-Type will be dynamically set depending on the provided extension. Example https://pomdtr-static.web.val.run/val_town_readme_style.css Val Link