/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
apps/api/exportOpenAPIJSON.ts
24 строки
775 B
Dima Grossman
revert: revert MRK-1000 commit that caused code deletion
20 авг 2025, 09:56
20 авг 2025, 09:56
7e61bca
Код
Авторство
О чём код?
import { writeFileSync } from 'node:fs'; import { bootstrap } from './src/bootstrap'; // Adjust the path according to your project structure async function exportOpenAPIJSON() { try { process.env.LOCAL_SWAGGER_GENERATION = 'true'; const { app, document } = await bootstrap({ internalSdkGeneration: true }); // Write the Swagger document to a file writeFileSync('./dist/swagger-spec.json', JSON.stringify(document, null, 2)); console.log('Swagger document generated at swagger-spec.json'); // Close the application await app.close(); console.log('App Closed'); } catch (error) { console.error('Error generating Swagger document:', error); } finally { // Ensure the process exits process.exit(); } } exportOpenAPIJSON();