2 Commits

Author SHA1 Message Date
KS Jannette
f2e1390507 cleanup 2026-02-13 13:35:11 -05:00
S Jannette
31496876a2 Merge pull request #7 from kjannette/refact2
env
2026-02-13 13:25:59 -05:00

View File

@@ -1,14 +1,9 @@
import { Router } from 'express'; import { Router } from 'express';
import { readFile } from 'fs/promises'; import { readFile } from 'fs/promises';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { clusterNotes } from '../services/clustering.service.js'; import { clusterNotes } from '../services/clustering.service.js';
const router = Router(); const router = Router();
const DATA_PATH = '../data/notes.json'
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const DATA_PATH = join(__dirname, '..', 'data', 'notes.json');
const loadNotes = async () => { const loadNotes = async () => {
const raw = await readFile(DATA_PATH, 'utf-8'); const raw = await readFile(DATA_PATH, 'utf-8');