a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add some logging for https requests

+30 -1
+30 -1
appview/index.ts
··· 1 + const https = require("https"); 2 + 3 + const originalRequest = https.request; 4 + 5 + https.request = function (options: any, callback: any) { 6 + console.log( 7 + "→", 8 + options.method || "GET", 9 + typeof options === "string" 10 + ? options 11 + : `${options.host}${options.path || "/"}`, 12 + ); 13 + 14 + const req = originalRequest.call(this, options, callback); 15 + 16 + req.on("response", (res) => { 17 + console.log( 18 + "←", 19 + res.statusCode, 20 + res.statusMessage, 21 + JSON.stringify(res.body || "No body"), 22 + ); 23 + }); 24 + 25 + return req; 26 + }; 27 + 1 28 import { createClient } from "@supabase/supabase-js"; 2 29 import { Database, Json } from "supabase/database.types"; 3 30 import { IdResolver } from "@atproto/identity"; ··· 32 59 async function main() { 33 60 let startCursor; 34 61 try { 35 - startCursor = parseInt((await readFile(cursorFile)).toString()); 62 + let file = (await readFile(cursorFile)).toString(); 63 + console.log(file); 64 + startCursor = parseInt(file); 36 65 } catch (e) {} 37 66 38 67 const client = await pool.connect();