Fix identified issues with server consolidation
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
const express = require('express');
|
||||
const path = require('path');
|
||||
import express from 'express';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
// ESM polyfill — Phase 9 §9.1. Handlers below use __dirname to resolve the
|
||||
// db-convert/db/files/{uploads,avatars} static asset paths.
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// Serve uploaded files with proper mapping from database paths to actual file locations
|
||||
@@ -646,4 +653,4 @@ router.get('/users/:userId/search', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user