update mime
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user