#!/usr/bin/env node /** * View Swagger documentation in browser * Opens ReDoc documentation for the generated swagger-output.json */ const http = require('http') const fs = require('fs') const path = require('path') const { spawn } = require('child_process') const swaggerPath = path.join(__dirname, 'docs', 'swagger-output.json') const port = 3004 if (!fs.existsSync(swaggerPath)) { console.error('swagger-output.json not found. Run "node swagger.js" first.') process.exit(1) } const html = `