Trouve-KA — moteur de recherche web indépendant, Québec-first. Crawler distribué, index OpenSearch, ranking bilingue, galerie d'images. En prod : www.trouve-ka.com
Python 51.9%
TypeScript 32.7%
JavaScript 4.8%
CSS 4.1%
Shell 2.9%
HTML 1.8%
SQL 1.5%
1// Auteur : Simon-Pierre Boucher — contact@spboucher.ai2// Favoris « Mon univers Ka » du membre connecté, lus au hub groupe-ka.com3// (magasin central — aucun stockage local, cache serveur 30 s dans hubfav).4// 401 sans session KA ID valide ; 502 si le hub est injoignable.5import { NextRequest, NextResponse } from "next/server";6import { SESSION_COOKIE, readSession } from "@/lib/ka-auth";7import { hubList } from "@/lib/hubfav";89export async function GET(req: NextRequest) {10 const session = readSession(req.cookies.get(SESSION_COOKIE)?.value);11 if (!session) {12 return NextResponse.json({ error: "Connexion KA ID requise." }, { status: 401 });13 }14 const favorites = await hubList(session.ka_id);15 if (favorites === null) {16 return NextResponse.json(17 { error: "Le hub Groupe KA est momentanément injoignable." },18 { status: 502 },19 );20 }21 return NextResponse.json(22 { favorites },23 { headers: { "Cache-Control": "no-store" } },24 );25}26