4import { thisWebURL } from "https://esm.town/v/stevekrouse/thisWebURL";
5
6export function createTable() {
7 return sqlite.execute(`
8 CREATE TABLE IF NOT EXISTS DateMeDocs (
29 (:Id, :Name, :Profile, :Gender, :Age, :Contact, :LastUpdated, :InterestedIn, :Location, :Style, :LocationFlexibility, :Community)`;
30
31export default async function() {
32 let docs = await getDocs();
33 return Response.json(docs);
34}
35
36export async function setupDatabase() {
37 await createTable();
38 const docs = await fetchJSON(thisWebURL());
4
5const { result } = core.runJavascript({
6 code: "function name() { return \"Hello\"; }",
7 "name": "name",
8});
9import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
10
11export default reloadOnSaveFetchMiddleware(async function(req: Request): Promise<Response> {
12 return html(`<h1>Hello!!</h1>`);
13})
1export default async function handler(request: Request) {
2 if (request.method !== "POST") {
3 return Response.json({ message: "This val responds to POST requests." }, {
4 * member.
5 */
6export const httpHandler = async function(req: Request): Promise<Response> {
7 if (req.method !== "POST") return new Response("Bad request: only POST allowed", { status: 400 });
8 const body = await req.json();
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export default async function() {
4 discordWebhook({
5 url: Deno.env.get("engDiscord"),
1import { email } from "https://esm.town/v/std/email?v=11";
2
3export default async function(e: Email) {
4 email({
5 subject: "Future of Coding Message: " + e.subject,
1import { blob } from "https://esm.town/v/std/blob?v=11";
2
3export default async function(req: Request): Promise<Response> {
4 const count = (await blob.getJSON("blobCounter") ?? 0) + 1;
5 await blob.setJSON("blobCounter", count);
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function listSqliteTables() {
4 return (await sqlite.execute(
5 `select name from sqlite_schema where type='table' and name != 'libsql_wasm_func_table' and name != 'sqlite_sequence'`,
1# filterVals
2
3This val exports a utility function that returns a list of all a user's val, filtered by a callback function.
4
5## Example