Spaces:
Running
Running
Update app.js
Browse files
app.js
CHANGED
|
@@ -3,7 +3,11 @@ import cors from 'cors';
|
|
| 3 |
import dotenv from 'dotenv';
|
| 4 |
|
| 5 |
// Import your modular apps here
|
|
|
|
| 6 |
import trendCatRouter from './apps/trend_cat.js';
|
|
|
|
|
|
|
|
|
|
| 7 |
import { generateCompletion, streamCompletion } from './ai_engine.js';
|
| 8 |
|
| 9 |
dotenv.config();
|
|
@@ -15,10 +19,11 @@ app.use(express.json({ limit: '50mb' }));
|
|
| 15 |
|
| 16 |
// Mount the App-Specific Routes
|
| 17 |
app.use('/api/trendcat', trendCatRouter);
|
|
|
|
| 18 |
// app.use('/api/drcat', drCatRouter); // Future app
|
| 19 |
// app.use('/api/chefcat', chefCatRouter); // Future app
|
| 20 |
|
| 21 |
-
|
| 22 |
// --- LEGACY/GENERIC ENDPOINTS (for fast testing without making a new router) ---
|
| 23 |
app.post('/api/generate', async (req, res) => {
|
| 24 |
const { model, prompt, system_prompt, images } = req.body;
|
|
@@ -47,6 +52,7 @@ app.post('/api/stream', async (req, res) => {
|
|
| 47 |
res.end();
|
| 48 |
}
|
| 49 |
});
|
|
|
|
| 50 |
|
| 51 |
app.get('/', async (req, res) => { res.json({ success: true, ecosystem: "Everyday Cats Backend" }); });
|
| 52 |
|
|
|
|
| 3 |
import dotenv from 'dotenv';
|
| 4 |
|
| 5 |
// Import your modular apps here
|
| 6 |
+
// Apps
|
| 7 |
import trendCatRouter from './apps/trend_cat.js';
|
| 8 |
+
import drCatRouter from './apps/dr_cat.js'; // <--- ADD THIS LINE
|
| 9 |
+
// Apps end
|
| 10 |
+
|
| 11 |
import { generateCompletion, streamCompletion } from './ai_engine.js';
|
| 12 |
|
| 13 |
dotenv.config();
|
|
|
|
| 19 |
|
| 20 |
// Mount the App-Specific Routes
|
| 21 |
app.use('/api/trendcat', trendCatRouter);
|
| 22 |
+
app.use('/api/drcat', drCatRouter); // <--- ADD THIS LINE
|
| 23 |
// app.use('/api/drcat', drCatRouter); // Future app
|
| 24 |
// app.use('/api/chefcat', chefCatRouter); // Future app
|
| 25 |
|
| 26 |
+
/*
|
| 27 |
// --- LEGACY/GENERIC ENDPOINTS (for fast testing without making a new router) ---
|
| 28 |
app.post('/api/generate', async (req, res) => {
|
| 29 |
const { model, prompt, system_prompt, images } = req.body;
|
|
|
|
| 52 |
res.end();
|
| 53 |
}
|
| 54 |
});
|
| 55 |
+
*/
|
| 56 |
|
| 57 |
app.get('/', async (req, res) => { res.json({ success: true, ecosystem: "Everyday Cats Backend" }); });
|
| 58 |
|