path correction

This commit is contained in:
sandhiya-hepl
2026-07-15 18:22:52 +05:30
parent e84c1adac4
commit abb35c0e03
15 changed files with 518 additions and 42 deletions
+8
View File
@@ -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' });