EN

@core / comments

1.0.1 ▾
verifiedMIT
GitHub

Moderated comments on any entity: guest or user, replies, optional 1–5 ratings, bans, GDPR erasure, safe HTML

Code9 filesContext~552 tokensscan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/lib/comments/adapters/hono.tsread-only · abfbbe8
// Adaptador Hono: `app.route('/api/comments', commentRoutes({ currentUser }))` → GET/POST /api/comments/:type/:id
import { Hono } from 'hono';
import type { Moderation } from '../index.ts';
import { type CurrentUser, handleList, handlePost } from './http.ts';

export function commentRoutes(opts: { currentUser: CurrentUser; moderation?: Moderation }) {
  return new Hono()
    .get('/:type/:id', (c) => handleList(c.req.raw, c.req.param('type'), c.req.param('id')))
    .post('/:type/:id', (c) => handlePost(c.req.raw, c.req.param('type'), c.req.param('id'), opts));
}

Report @core/comments

Sign in with GitHub to report a package.