65 lines
2.1 KiB
Diff
65 lines
2.1 KiB
Diff
diff --git a/src/algos/index.ts b/src/algos/index.ts
|
|
index b7ee48a..102cb93 100644
|
|
--- a/src/algos/index.ts
|
|
+++ b/src/algos/index.ts
|
|
@@ -4,11 +4,13 @@ import {
|
|
OutputSchema as AlgoOutput,
|
|
} from '../lexicon/types/app/bsky/feed/getFeedSkeleton'
|
|
import * as whatsAlf from './whats-alf'
|
|
+import * as app from './app'
|
|
|
|
type AlgoHandler = (ctx: AppContext, params: QueryParams) => Promise<AlgoOutput>
|
|
|
|
const algos: Record<string, AlgoHandler> = {
|
|
[whatsAlf.shortname]: whatsAlf.handler,
|
|
+ [app.shortname]: app.handler,
|
|
}
|
|
|
|
export default algos
|
|
diff --git a/src/index.ts b/src/index.ts
|
|
index 7128525..40d985c 100644
|
|
--- a/src/index.ts
|
|
+++ b/src/index.ts
|
|
@@ -22,8 +22,10 @@ const run = async () => {
|
|
})
|
|
await server.start()
|
|
console.log(
|
|
- `🤖 running feed generator at http://${server.cfg.listenhost}:${server.cfg.port}`,
|
|
+ `running feed generator at http://${server.cfg.listenhost}:${server.cfg.port}`,
|
|
)
|
|
+ console.log('Supported algos:', Object.keys(require('./algos').default))
|
|
+ console.log('Publisher DID:', server.cfg.publisherDid)
|
|
}
|
|
|
|
const maybeStr = (val?: string) => {
|
|
diff --git a/src/methods/feed-generation.ts b/src/methods/feed-generation.ts
|
|
index 0f4989e..17be062 100644
|
|
--- a/src/methods/feed-generation.ts
|
|
+++ b/src/methods/feed-generation.ts
|
|
@@ -10,7 +10,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
const feedUri = new AtUri(params.feed)
|
|
const algo = algos[feedUri.rkey]
|
|
if (
|
|
- feedUri.hostname !== ctx.cfg.publisherDid ||
|
|
+ //feedUri.hostname !== ctx.cfg.publisherDid ||
|
|
feedUri.collection !== 'app.bsky.feed.generator' ||
|
|
!algo
|
|
) {
|
|
diff --git a/package.json b/package.json
|
|
index 1431a9e..6a7c33c 100644
|
|
--- a/package.json
|
|
+++ b/package.json
|
|
@@ -23,9 +23,11 @@
|
|
"dotenv": "^16.0.3",
|
|
"express": "^4.18.2",
|
|
"kysely": "^0.27.4",
|
|
- "multiformats": "^9.9.0"
|
|
+ "multiformats": "^9.9.0",
|
|
+ "ws": "^8.14.2"
|
|
},
|
|
"devDependencies": {
|
|
+ "@types/ws": "^8.5.10",
|
|
"@types/better-sqlite3": "^7.6.11",
|
|
"@types/express": "^4.17.17",
|
|
"@types/node": "^20.1.2",
|