log stuff

This commit is contained in:
Siddharth Singh 2024-08-05 21:32:44 +05:30
parent 9175596d5f
commit a3012d341b
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

View file

@ -60,7 +60,8 @@ export const frontendController: AppMiddleware = async (c, next) => {
try { try {
const meta = metadataView(await buildTemplateOpts(params, Conf.local(c.req.path))); const meta = metadataView(await buildTemplateOpts(params, Conf.local(c.req.path)));
return c.html(content.replace(META_PLACEHOLDER, meta)); return c.html(content.replace(META_PLACEHOLDER, meta));
} catch { } catch (e) {
console.debug(e);
return c.html(content); return c.html(content);
} }
} }

View file

@ -3,9 +3,12 @@ import { getEvent } from '@/queries.ts';
import { nip19, nip27 } from 'nostr-tools'; import { nip19, nip27 } from 'nostr-tools';
import { match } from 'path-to-regexp'; import { match } from 'path-to-regexp';
import { Stickynotes } from '@soapbox/stickynotes';
import { lookupAccount, lookupPubkey } from '@/utils/lookup.ts'; import { lookupAccount, lookupPubkey } from '@/utils/lookup.ts';
import { parseAndVerifyNip05 } from '@/utils/nip05.ts'; import { parseAndVerifyNip05 } from '@/utils/nip05.ts';
const console = new Stickynotes('ditto:frontend');
export interface OpenGraphTemplateOpts { export interface OpenGraphTemplateOpts {
title: string; title: string;
type: 'article' | 'profile' | 'website'; type: 'article' | 'profile' | 'website';
@ -78,6 +81,7 @@ type ProfileInfo = { name: string; about: string } & NostrMetadata;
* or sensible defaults if the kind 0 has those values missing. * or sensible defaults if the kind 0 has those values missing.
*/ */
export async function getProfileInfo(handle: string | undefined): Promise<ProfileInfo> { export async function getProfileInfo(handle: string | undefined): Promise<ProfileInfo> {
console.debug(handle);
const acc = await lookupAccount(handle || ''); const acc = await lookupAccount(handle || '');
if (!acc) throw new Error('Invalid handle specified, or account not found.'); if (!acc) throw new Error('Invalid handle specified, or account not found.');