Spaces:
Paused
Paused
Fix: Make Notion routes optional (try/catch dynamic import)
Browse files
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 |
-
|
| 1408 |
-
|
| 1409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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) => {
|