pomdtr avatar
pomdtr
auth_middleware
Script
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.
1
pomdtr avatar
pomdtr
cmdk_v1
Script
An interactive, runnable TypeScript val by pomdtr
1
pomdtr avatar
pomdtr
article
HTTP
Use readme as website Usage import {article} from "https://esm.town/v/pomdtr/article" export default article() See this val http endpoint as an example: https://pomdtr-article.web.val.run
1
pomdtr avatar
pomdtr
sqliteTable
Script
Sqlite Table Usage: Fork this Val Replace the existing migrations by your own table The table name will match the val name. To update the table, just add new items to the migrations array, and re-run the val
0
pomdtr avatar
pomdtr
devtools
Script
Devtools shortcuts Add useful shortcuts to a val website. Usage /_edit -> go to the val editor /_raw -> view val source /_logs -> view val logs Example import { devtools } from "https://esm.town/v/pomdtr/devtools"; export default devtools((_req: Request) => { return new Response("hello world"); });
4
pomdtr avatar
pomdtr
echoRef
Script
An interactive, runnable TypeScript val by pomdtr
0
pomdtr avatar
pomdtr
serve_readme
Script
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 )
0
pomdtr avatar
pomdtr
kv
Script
Usage import { openKv } from "https://esm.town/v/pomdtr/kv" const kv = openKv() await kv.set("test", true) console.log(await kv.get("test"))
3
pomdtr avatar
pomdtr
readme
Script
An interactive, runnable TypeScript val by pomdtr
0
cooka avatar
cooka
serve_readme
Script
Forked from pomdtr/serve_readme
0
stevekrouse avatar
stevekrouse
auth_middleware
Script
Forked from pomdtr/auth_middleware
0
pomdtr avatar
pomdtr
lowdb_example
Script
Lowdb Example This val demonstrates the integration between valtown and lowdb . Read the Lodash section if you want to give superpowers to your DB.
4
1
Next
Updated: December 11, 2023