Public
Script
  • pomdtr avatar
    blog_mdx
    @pomdtr
    @jsxImportSource https://esm.sh/preact
    HTTP (deprecated)
  • pomdtr avatar
    serve_readme
    @pomdtr
    Serve Readme Usage import codeOnValTown from "https://esm.town/v/andreterron/codeOnValTown?v=50"; import { serveReadme } from "https://esm.town/v/pomdtr/serve_readme"; const val = extractValInfo(import.meta.url); export default serveReadme({ val, title: "Code Search is Easy", }); Example @pomdtr/code_search_is_easy (rendered at https://code-search-is-easy.pomdtr.me )
    Script
  • vladimyr avatar
    serveReadme
    @vladimyr
    // SPDX-License-Identifier: 0BSD
    Script
  • iamseeley avatar
    HonoHTMX
    @iamseeley
    Forked from mxdvl/vals
    HTTP (deprecated)
  • nbbaier avatar
    vtIdeaAggregator
    @nbbaier
    Forked from pomdtr/blog
    HTTP (deprecated)
  • pomdtr avatar
    blog
    @pomdtr
    Val Town Blog A blog written, developed and hosted on val.town. How ? Each article on this blog is contained single val, with a #blog tag. See this example article . // #blog // title: Example Post import { article } from "https://esm.town/v/pomdtr/article"; import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo"; import { html } from "https://esm.town/v/stevekrouse/html?v=5"; export async function examplePost(req: Request) { const { author, name } = extractValInfo(import.meta.url); return html(await article(author, name)); } Each of these post work on it's own . This val is able to: list them with the /v1/search api (with a #blog query) post with different author than the owner of this val will be filtered out only public vals will be listed render the readme of those vals using remark (with github styling) This process run each time a user visit the web endpoint , so the blog is always up to date. You can get your own instance of the blog by just forking this val .
    HTTP (deprecated)
  • pomdtr avatar
    todo
    @pomdtr
    All TODOs from public vals Todo [ ] Remove forks from results ? [ ] use a cron val to cache results in an sqlite table
    HTTP (deprecated)
  • pomdtr avatar
    auth_middleware
    @pomdtr
    Authentication middleware Guards your public http vals behind a login page. This val use a json web token stored as an http-only cookie to persist authentication. Usage Set an AUTH_SECRET_KEY env variable (used to sign/verify jwt tokens) to a random string . Then use an API token to authenticate. import { auth } from "https://esm.town/v/pomdtr/auth_middleware"; async function handler(req: Request): Promise<Response> { return new Response("You are authenticated!"); } export default auth(handler); See @pomdtr/test_auth for an example ⚠️ Make sure to only provides your api token to vals you trust (i.e. your own), as it gives access to your whole account.
    Script
  • vladimyr avatar
    valshot
    @vladimyr
    Val Shot Generate val source code screenshot using sourcecodeshots.com ⚠️ This service is offered for personal use under a reasonable usage policy as stated here: https://sourcecodeshots.com/docs 📣 Special thanks to @pomdtr for their help and contributions! Usage https://vladimyr-valshot.web.val.run/v/<author>/<val> Example https://vladimyr-valshot.web.val.run/v/vladimyr/valshot https://vladimyr-valshot.web.val.run/v/pomdtr/readme
    HTTP (deprecated)
  • pomdtr avatar
    static
    @pomdtr
    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
    HTTP (deprecated)
  • mxdvl avatar
    vals
    @mxdvl
    A val to list other vals, very meta! You’re likely viewing this page generated from this very val… fork your own! Until folder sharing is supported, this may be the best way to point to specific vals?
    HTTP (deprecated)
2
Next
March 6, 2024