path correction
This commit is contained in:
@@ -33,6 +33,14 @@ app.use('/api/auth', authRoutes);
|
||||
app.use('/api/content', contentRoutes);
|
||||
app.use('/api/upload', uploadRoutes);
|
||||
|
||||
// Optional: serve Vite dist from Node (set SERVE_STATIC=1). Useful when Apache
|
||||
// proxies the whole /citpl_website path to this process.
|
||||
if (process.env.SERVE_STATIC === '1') {
|
||||
const distDir = path.join(__dirname, '..', 'dist');
|
||||
app.use(express.static(distDir));
|
||||
app.use('/citpl_website', express.static(distDir));
|
||||
}
|
||||
|
||||
app.use((err, _req, res, _next) => {
|
||||
if (err instanceof multer.MulterError && err.code === 'LIMIT_FILE_SIZE') {
|
||||
return res.status(413).json({ error: 'File too large (max 50MB)', code: 'FILE_TOO_LARGE' });
|
||||
|
||||
Reference in New Issue
Block a user