fix: nginx proxy URI, SW cache, sw.js no-cache

This commit is contained in:
Claude
2026-05-01 07:53:56 +02:00
parent 16820c5c14
commit e67574f1c6
8 changed files with 45 additions and 6 deletions
+3 -1
View File
@@ -34,4 +34,6 @@
"@types/uuid": "^10.0.0",
"drizzle-kit": "^0.22.7",
"ts-node-dev": "^2.0.0",
"typescript": "^5.4
"typescript": "^5.4.5"
}
}
+14 -1
View File
@@ -58,4 +58,17 @@ if (fs.existsSync(publicDir)) {
// Manifeste PWA — pas de cache long
app.get(/\.webmanifest$/, (_req, res, next) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
res.set
res.setHeader('Expires', '0')
next()
})
app.use(express.static(publicDir))
app.get('*', (_req, res) => res.sendFile(path.join(publicDir, 'index.html')))
}
// ─── Start ────────────────────────────────────────────────────────────────────
app.listen(PORT, () => {
console.log(`✓ ShootTracker backend → http://localhost:${PORT}`)
console.log(` Uploads : ${UPLOADS_DIR}`)
console.log(` AI : ${process.env.AI_SERVICE_URL || 'http://localhost:8000'}`)
})
+2 -1
View File
@@ -168,4 +168,5 @@ exportRouter.get('/excel', (req: AuthRequest, res) => {
const filename = `shoottracker_${format(new Date(), 'yyyy-MM-dd')}.xlsx`
res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
res.setHeader('Content-Disposition', `attachment; filename="${filename}"`)
res.send(XLSX.write(wb, { type: 'buffer', bookType:
res.send(XLSX.write(wb, { type: 'buffer', bookType: 'xlsx' }))
})
+1
View File
@@ -16,3 +16,4 @@
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}