feat(twa): agregar .well-known/assetlinks.json para verificacion oficial Google Play Android
@@ -0,0 +1,8 @@
|
|||||||
|
[{
|
||||||
|
"relation": ["delegate_permission/common.handle_all_urls"],
|
||||||
|
"target": {
|
||||||
|
"namespace": "android_app",
|
||||||
|
"package_name": "com.sibopay.twa",
|
||||||
|
"sha256_cert_fingerprints": ["A5:ED:D0:0A:24:5F:96:93:15:DE:D9:24:42:BD:43:00:AE:0A:65:5A:B0:88:EA:CC:94:E9:A7:98:C5:23:26:9B"]
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
Before Width: | Height: | Size: 620 KiB After Width: | Height: | Size: 620 KiB |
|
Before Width: | Height: | Size: 290 KiB After Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 924 KiB After Width: | Height: | Size: 924 KiB |
|
Before Width: | Height: | Size: 355 KiB After Width: | Height: | Size: 355 KiB |
|
Before Width: | Height: | Size: 213 KiB After Width: | Height: | Size: 213 KiB |
@@ -118,13 +118,20 @@ app.get('/desktop-preview.html', (req, res) => {
|
|||||||
res.redirect(301, '/');
|
res.redirect(301, '/');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Android Digital Asset Links para TWA (Google Play Store)
|
||||||
|
app.get(['/.well-known/assetlinks.json', '/.well-known/assetlinks'], (req, res) => {
|
||||||
|
res.setHeader('Content-Type', 'application/json');
|
||||||
|
res.sendFile(path.join(__dirname, '../public/.well-known/assetlinks.json'));
|
||||||
|
});
|
||||||
|
|
||||||
// Servir archivos estáticos con compresión y caché optimizado para PWA
|
// Servir archivos estáticos con compresión y caché optimizado para PWA
|
||||||
app.use(express.static(path.join(__dirname, '../public'), {
|
app.use(express.static(path.join(__dirname, '../public'), {
|
||||||
|
dotfiles: 'allow',
|
||||||
etag: true,
|
etag: true,
|
||||||
maxAge: '1d',
|
maxAge: '1d',
|
||||||
setHeaders: (res, filePath) => {
|
setHeaders: (res, filePath) => {
|
||||||
// Para HTML y Service Worker: siempre revalidar para garantizar actualizaciones inmediatas
|
// Para HTML y Service Worker: siempre revalidar para garantizar actualizaciones inmediatas
|
||||||
if (filePath.endsWith('.html') || filePath.endsWith('sw.js') || filePath.endsWith('manifest.json')) {
|
if (filePath.endsWith('.html') || filePath.endsWith('sw.js') || filePath.endsWith('manifest.json') || filePath.includes('assetlinks.json')) {
|
||||||
res.setHeader('Cache-Control', 'no-cache, must-revalidate');
|
res.setHeader('Cache-Control', 'no-cache, must-revalidate');
|
||||||
} else {
|
} else {
|
||||||
// Para CSS, JS, imágenes y fuentes: permitir caché con stale-while-revalidate para arranque instantáneo
|
// Para CSS, JS, imágenes y fuentes: permitir caché con stale-while-revalidate para arranque instantáneo
|
||||||
|
|||||||