feat: centraliser le moteur IA via le Référentiel
All checks were successful
Deploy Production / deploy (push) Has been skipped
Deploy Recette / deploy (push) Successful in 1m32s
Validation applicative / TypeScript, tests et build (push) Successful in 2m42s

This commit is contained in:
manus-admin
2026-09-14 08:35:32 +00:00
parent 290e3709e2
commit 9db76af02c
7 changed files with 259 additions and 19 deletions

View File

@@ -15,6 +15,7 @@ import { ensureAdminExists, generateLocalToken } from "../localAuth";
import { isAzureAdConfigured, getAzureAuthUrl, handleAzureCallback } from "../azureAuth";
import { getLocalUserByAzureAdId, getLocalUserByEmail, upsertLocalUserAzure, getSetting, purgeOldArticles } from "../db";
import { runRssFetch } from "../rssEngine";
import { getActiveAiConfiguration } from "../ai-reference";
function isPortAvailable(port: number): Promise<boolean> {
return new Promise(resolve => {
@@ -123,6 +124,11 @@ async function startServer() {
app.use(express.json({ limit: "50mb" }));
app.use(express.urlencoded({ limit: "50mb", extended: true }));
app.get("/api/ai/active-configuration", (_request, response) => {
void getActiveAiConfiguration()
.then(configuration => response.setHeader("Cache-Control", "no-store").json(configuration))
.catch(() => response.status(503).json({ active: false, engines: [] }));
});
registerOAuthRoutes(app);
app.use(uploadRoutes);