fix: nginx proxy URI, SW cache, sw.js no-cache
This commit is contained in:
@@ -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
@@ -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'}`)
|
||||
})
|
||||
|
||||
@@ -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' }))
|
||||
})
|
||||
|
||||
@@ -16,3 +16,4 @@
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user