set mongo security
This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
import app from './app';
|
||||
import http from 'http';
|
||||
import ip from 'ip';
|
||||
|
||||
// import { startHealthCheck } from './controller/user-Controller';
|
||||
import swaggerUi from 'swagger-ui-express';
|
||||
import mongoAdminCreation from '../shared/security/mongosecurity';
|
||||
const server = http.createServer(app);
|
||||
|
||||
let swaggerDocument;
|
||||
try {
|
||||
|
||||
swaggerDocument = require('../../swagger-output.json');
|
||||
} catch (error) {
|
||||
console.error('Error loading Swagger JSON:', error);
|
||||
swaggerDocument = {}; // Fallback: empty object or some default
|
||||
}
|
||||
|
||||
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
|
||||
const organization = process.env.ORGANIZATION_NAME || 'defaultOrganization'; // Replace with your logic
|
||||
|
||||
mongoAdminCreation()
|
||||
if (!organization) {
|
||||
throw new Error('ORGANIZATION_NAME is not defined in the environment');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user