Refine and cleanup

This commit is contained in:
KS Jannette
2026-02-13 10:42:37 -05:00
parent 02affb154c
commit 6b7324c320
10 changed files with 1306 additions and 20 deletions

View File

@@ -1,13 +1,13 @@
import express from 'express';
import cors from 'cors';
import notesRoutes from './routes/notes.routes.js';
import router from './routes/notes.routes.js';
const app = express();
app.use(cors());
app.use(express.json());
app.use('/v1/notes', notesRoutes);
app.use('/v1/notes', router);
app.use((req, res) => {
res.status(404).json({ error: `Requested path is invalid or does not exist: ${req.method} ${req.originalUrl}` });

View File

@@ -1,5 +0,0 @@
const config = {
port: process.env.PORT || 3001,
};
export default config;

1292
backend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -30,7 +30,7 @@ router.post('/cluster', async (req, res) => {
const clusters = await clusterNotes(notes);
res.json(clusters);
} catch (err) {
res.status(500).json({ error: 'Clustering failed' });
res.status(500).json({ error: `Clustering failed: ${err}` });
}
});

View File

@@ -1,7 +1,6 @@
import app from './app.js';
import config from './config/index.js';
const PORT = config.port || 3001;
const PORT = process.env.PORT || 3001;
app.listen(PORT, () => {
console.log(`Backend running on port ${PORT}`);