This commit is contained in:
seb
2026-09-29 11:21:55 +02:00
parent 3089cc7252
commit cf4af1480b
7 changed files with 173 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import { authMiddleware } from './middleware/auth.js';
import { ensureConnection } from '../db/store.js';
import { closeAll as closeAllSse } from './sse.js';
import { getOrCreateCert } from '../util/cert.js';
import v1Router from '../v1/index.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -85,6 +86,8 @@ async function createApi() {
}
await loadRoutes(app, '/api');
app.use('/v1', v1Router);
app.use('/api/v1', v1Router);
app.use((err, _req, res, next) => {
if (err.type === 'entity.too.large') {

View File

@@ -51,6 +51,10 @@ export const authMiddleware = async (req, res, next) => {
return next();
}
if (req.path.startsWith('/v1') || req.path.startsWith('/api/v1')) {
return next();
}
if (req.path.startsWith('/@') || req.path.startsWith('/node_modules') || req.path.startsWith('/src') || req.path === '/favicon.ico') {
return next();
}