diff --git a/keyserver/flow-typed/npm/@hono/node-server_vx.x.x.js b/keyserver/flow-typed/npm/@hono/node-server_vx.x.x.js --- a/keyserver/flow-typed/npm/@hono/node-server_vx.x.x.js +++ b/keyserver/flow-typed/npm/@hono/node-server_vx.x.x.js @@ -15,3 +15,15 @@ param(): { +[key: string]: string }; } } + +declare module '@hono/node-server/serve-static' { + + import type { MiddlewareHandler } from 'hono'; + + declare export type ServeStaticOptions = { + +path: ?string, + ... + } + + declare export var serveStatic: ServeStaticOptions => MiddlewareHandler; +} diff --git a/keyserver/flow-typed/npm/frog_v0.18.x.js b/keyserver/flow-typed/npm/frog_v0.18.x.js --- a/keyserver/flow-typed/npm/frog_v0.18.x.js +++ b/keyserver/flow-typed/npm/frog_v0.18.x.js @@ -4,6 +4,7 @@ declare module 'frog' { import type { Fetch, HonoRequest } from '@hono/node-server'; + import type { Hono } from 'hono'; declare type FrameResponse = { +image: React$Node, @@ -40,6 +41,7 @@ route: string, callback: (c: FrameContext) => Promise<FrogResponse> | FrogResponse, ): void; + hono: Hono, fetch: Fetch, } } diff --git a/keyserver/flow-typed/npm/hono_vx.x.x.js b/keyserver/flow-typed/npm/hono_vx.x.x.js new file mode 100644 --- /dev/null +++ b/keyserver/flow-typed/npm/hono_vx.x.x.js @@ -0,0 +1,15 @@ +// flow-typed signature: 06706c2a95e8f8228cf2ed3a7f3a1366 +// flow-typed version: <<STUB>>/hono_v4.6.9/flow_v0.202.1 + +declare module 'hono' { + + declare export opaque type MiddlewareHandler; + + declare export class Hono { + use( + route: string, + handler: MiddlewareHandler, + ): mixed; + } +} + diff --git a/keyserver/images/default_farcaster_channel_cover.png b/keyserver/images/default_farcaster_channel_cover.png new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@<O00001 literal 0 Hc$@<O00001 diff --git a/keyserver/src/frog/frog.js b/keyserver/src/frog/frog.js --- a/keyserver/src/frog/frog.js +++ b/keyserver/src/frog/frog.js @@ -4,6 +4,8 @@ /* eslint-disable react/react-in-jsx-scope */ import { serve } from '@hono/node-server'; +// eslint-disable-next-line import/extensions +import { serveStatic } from '@hono/node-server/serve-static'; import { Button, Frog } from 'frog'; import { inviteLinkURL } from 'lib/facts/links.js'; @@ -15,6 +17,11 @@ function startFrogHonoServer() { const frogApp = new Frog({ title: 'Comm' }); + frogApp.hono.use( + '/default_farcaster_channel_cover.png', + serveStatic({ path: './images/default_farcaster_channel_cover.png' }), + ); + frogApp.frame('/:inviteLink/:channelID/:taggerUsername', async c => { const { inviteLink, channelID, taggerUsername } = c.req.param(); @@ -36,8 +43,7 @@ } } - let header_image_url = - 'https://warpcast.com/~/images/DefaultChannelCoverImage.png'; + let header_image_url = '/default_farcaster_channel_cover.png'; if (channelInfo?.header_image_url) { header_image_url = channelInfo.header_image_url; }