Kraft102 commited on
Commit
22839e7
·
verified ·
1 Parent(s): d4ed816

Fix: Make Notion routes optional (try/catch dynamic import)

Browse files
Files changed (1) hide show
  1. apps/backend/src/index.ts +8 -4
apps/backend/src/index.ts CHANGED
@@ -1402,11 +1402,15 @@ async function startServer() {
1402
  console.log('📦 Showpad API mounted at /api/showpad');
1403
 
1404
  // ============================================
1405
- // 📝 NOTION - CORTEX Dashboard Integration
1406
  // ============================================
1407
- const notionRouter = (await import('./routes/notion.js')).default;
1408
- app.use('/api/notion', notionRouter);
1409
- console.log('📝 Notion CORTEX API mounted at /api/notion');
 
 
 
 
1410
 
1411
  // Graceful shutdown handler
1412
  const gracefulShutdown = async (signal: string) => {
 
1402
  console.log('📦 Showpad API mounted at /api/showpad');
1403
 
1404
  // ============================================
1405
+ // 📝 NOTION - CORTEX Dashboard Integration (Optional)
1406
  // ============================================
1407
+ try {
1408
+ const notionRouter = (await import('./routes/notion.js')).default;
1409
+ app.use('/api/notion', notionRouter);
1410
+ console.log('📝 Notion CORTEX API mounted at /api/notion');
1411
+ } catch (err) {
1412
+ console.log('⚠️ Notion routes not available (optional module)');
1413
+ }
1414
 
1415
  // Graceful shutdown handler
1416
  const gracefulShutdown = async (signal: string) => {