1
0

update mime

This commit is contained in:
unfr
2025-10-12 15:31:57 +02:00
parent 4949790bd0
commit 39121427db
2 changed files with 13 additions and 400 deletions

View File

@@ -171,17 +171,24 @@ app.use('/autopost', express.static(path.join(__dirname, 'public'), {
}));
// Servez aussi les vendors sous /autopost
const tailwindPath = path.join(__dirname, '/node_modules/@tailwindcss/browser/dist');
const jqueryPath = path.join(__dirname, '/node_modules/jquery/dist');
console.log('[STATIC] Tailwind path:', tailwindPath, '- exists:', fs.existsSync(tailwindPath));
console.log('[STATIC] jQuery path:', jqueryPath, '- exists:', fs.existsSync(jqueryPath));
app.use('/js', express.static(
path.join(__dirname, '../node_modules/@tailwindcss/browser/dist'),
tailwindPath,
{ setHeaders: (res, filepath) => {
console.log('[STATIC] /js serving:', filepath);
if (filepath.endsWith('.js')) {
res.setHeader('Content-Type', 'application/javascript');
}
}}
));
app.use('/jquery', express.static(
path.join(__dirname, '../node_modules/jquery/dist'),
jqueryPath,
{ setHeaders: (res, filepath) => {
console.log('[STATIC] /jquery serving:', filepath);
if (filepath.endsWith('.js')) {
res.setHeader('Content-Type', 'application/javascript');
}
@@ -190,16 +197,18 @@ app.use('/jquery', express.static(
// Miroir des vendors sous /autopost (si reverse-proxy ne forwarde que /autopost/*)
app.use('/autopost/js', express.static(
path.join(__dirname, '../node_modules/@tailwindcss/browser/dist'),
tailwindPath,
{ setHeaders: (res, filepath) => {
console.log('[STATIC] /autopost/js serving:', filepath);
if (filepath.endsWith('.js')) {
res.setHeader('Content-Type', 'application/javascript');
}
}}
));
app.use('/autopost/jquery', express.static(
path.join(__dirname, '../node_modules/jquery/dist'),
jqueryPath,
{ setHeaders: (res, filepath) => {
console.log('[STATIC] /autopost/jquery serving:', filepath);
if (filepath.endsWith('.js')) {
res.setHeader('Content-Type', 'application/javascript');
}