Fix module issues, fix styling, add conditions to when the background removal and edit controls are shown

This commit is contained in:
khalid@traclabs.com
2026-04-23 08:48:11 -05:00
parent 4d19363d58
commit 628a6765f4
32 changed files with 11663 additions and 287 deletions

View File

@@ -4,7 +4,7 @@ import multer from 'multer';
import { v4 as uuidv4 } from 'uuid';
import sharp from 'sharp';
import { createCanvas, loadImage } from 'canvas';
import { fileURLToPath } from 'module';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { mkdirSync, existsSync, writeFileSync } from 'fs';
@@ -38,6 +38,14 @@ app.use('/exports', express.static(exportsDir));
if (IS_PRODUCTION) {
const clientDist = join(__dirname, 'dist');
app.use(express.static(clientDist));
} else {
// Dev UX: backend doesn't serve the SPA; Vite does.
app.get('/', (_req, res) => {
res
.status(302)
.set('Location', 'http://localhost:5173/')
.send('Redirecting to Vite dev server...');
});
}
// Map MIME types to file extensions