Fix module issues, fix styling, add conditions to when the background removal and edit controls are shown
This commit is contained in:
10
server.js
10
server.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user