u
This commit is contained in:
@@ -13,7 +13,7 @@ const root = path.resolve(__dirname, '..');
|
||||
const docsDir = path.join(root, 'docs', 'api');
|
||||
const routesDocsDir = path.join(docsDir, 'routes');
|
||||
|
||||
const PUBLIC_PATHS = new Set(['/auth/login', '/auth/logout', '/health']);
|
||||
const PUBLIC_PATHS = new Set(['/auth/login', '/auth/logout', '/health', '/v1/client']);
|
||||
|
||||
const options = {
|
||||
definition: {
|
||||
@@ -26,10 +26,14 @@ const options = {
|
||||
'Browser clients must send cookies (`credentials: \'include\'`). ' +
|
||||
'Sessions use an HTTP-only `token` cookie (`Secure`, `SameSite=Strict`, 24h); HTTPS is required for login.',
|
||||
},
|
||||
servers: [{ url: 'http://localhost:4208/api', description: 'Local default (PORT / .env)' }],
|
||||
servers: [
|
||||
{ url: 'http://localhost:4208/api', description: 'Local default HTTP (PORT / .env)' },
|
||||
{ url: 'https://localhost:8443', description: 'Local default HTTPS (HTTPS_PORT / .env)' },
|
||||
],
|
||||
tags: [
|
||||
{ name: 'Auth', description: 'Google SSO and session' },
|
||||
{ name: 'Health', description: 'Connectivity checks' },
|
||||
{ name: 'POS', description: 'POS bind and sync API (/v1)' },
|
||||
{ name: 'Events', description: 'SSE update signals for live clients' },
|
||||
{ name: 'Article', description: 'Articles under categories' },
|
||||
{ name: 'Category', description: 'Category tree and membership' },
|
||||
@@ -55,6 +59,7 @@ const options = {
|
||||
apis: [
|
||||
path.join(root, 'src/api/openapi.js'),
|
||||
path.join(root, 'src/api/routes/**/*.js'),
|
||||
path.join(root, 'src/v1/**/*.js'),
|
||||
],
|
||||
};
|
||||
|
||||
@@ -352,6 +357,8 @@ function renderReadme(operations) {
|
||||
lines.push('');
|
||||
lines.push('```');
|
||||
lines.push('http://localhost:4208/api');
|
||||
lines.push('https://localhost:8443/api');
|
||||
lines.push('https://localhost:8443/v1 (POS API)');
|
||||
lines.push('```');
|
||||
lines.push('');
|
||||
lines.push('## CORS & cookies');
|
||||
|
||||
Reference in New Issue
Block a user