comment out auth check & log firehose output
This commit is contained in:
parent
eeeb0325fc
commit
cacc046986
@ -8,13 +8,15 @@ export default function (server: Server, ctx: AppContext) {
|
||||
if (params.feed !== 'did:example:alice/app.bsky.feed.generator/whats-alf') {
|
||||
throw new InvalidRequestError('algorithm unsupported')
|
||||
}
|
||||
// example of how to check auth
|
||||
// feel free to remove if requesterDid is not used
|
||||
const requesterDid = await validateAuth(
|
||||
req,
|
||||
ctx.cfg.serviceDid,
|
||||
ctx.didResolver,
|
||||
)
|
||||
/**
|
||||
* Example of how to check auth if giving user-specific results:
|
||||
*
|
||||
* const requesterDid = await validateAuth(
|
||||
* req,
|
||||
* ctx.cfg.serviceDid,
|
||||
* ctx.didResolver,
|
||||
* )
|
||||
*/
|
||||
|
||||
let builder = ctx.db
|
||||
.selectFrom('post')
|
||||
|
@ -8,6 +8,14 @@ export class FirehoseSubscription extends FirehoseSubscriptionBase {
|
||||
async handleEvent(evt: RepoEvent) {
|
||||
if (!isCommit(evt)) return
|
||||
const ops = await getOpsByType(evt)
|
||||
|
||||
// This logs the text of every post off the firehose.
|
||||
// Just for fun :)
|
||||
// Delete before actually using
|
||||
for (const post of ops.posts.creates) {
|
||||
console.log(post.record.text)
|
||||
}
|
||||
|
||||
const postsToDelete = ops.posts.deletes.map((del) => del.uri)
|
||||
const postsToCreate = ops.posts.creates
|
||||
.filter((create) => {
|
||||
|
Loading…
Reference in New Issue
Block a user