update a lot of change since a while

This commit is contained in:
2026-01-22 10:29:36 +01:00
parent a4dcb95d83
commit e1c1475f10
78 changed files with 4200 additions and 534 deletions

17
server/api/log.post.js Normal file
View File

@@ -0,0 +1,17 @@
import logger from '~~/server/utils/logger';
const ALLOWED_LEVELS = ['info', 'warn', 'error'];
export default defineEventHandler(async (event) => {
const body = await readBody(event);
const { level, message, meta } = body || {};
const logLevel = ALLOWED_LEVELS.includes(level) ? level : 'info';
logger[logLevel](message, {
label: 'front-end',
...meta,
});
return { status: 'ok' };
});