Back

Version 79

10/17/2023
function sunbeamValTownFn(valtownToken: string) {
return async (req: Request) => {
const { Hono } = await import("npm:hono");
const app = new Hono();
// extension manifest
app.get("/", async (c) => {
const resp = await fetch("https://api.val.town/v1/me", {
headers: {
Authorization: `Bearer ${valtownToken}`,
},
});
const { id: userID } = await resp.json();
return c.json({
title: "Val Town",
commands: [
{
name: "search-vals",
title: "List Vals",
mode: "view",
params: [
{
name: "user",
type: "string",
description: "User ID",
default: userID,
},
],
},
{
name: "view-val",
title: "view-val",
mode: "view",
params: [
{
name: "val",
type: "string",
pomdtr-sunbeamvaltownfn.web.val.run
Updated: October 23, 2023