Set up initial frontend with Vite and integrated Docker for full-stack build
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "Budget Commun",
|
||||
"short_name": "Budget",
|
||||
"description": "Gestion du budget commun du couple",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#0f0e0c",
|
||||
"theme_color": "#0f0e0c",
|
||||
"orientation": "portrait",
|
||||
"icons": [
|
||||
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
|
||||
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
const CACHE = "budget-commun-v2";
|
||||
const ASSETS = ["/", "/index.html", "/manifest.json"];
|
||||
|
||||
self.addEventListener("install", e => {
|
||||
e.waitUntil(caches.open(CACHE).then(c => c.addAll(ASSETS)));
|
||||
self.skipWaiting();
|
||||
});
|
||||
|
||||
self.addEventListener("activate", e => {
|
||||
e.waitUntil(caches.keys().then(keys =>
|
||||
Promise.all(keys.filter(k => k !== CACHE).map(k => caches.delete(k)))
|
||||
));
|
||||
self.clients.claim();
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", e => {
|
||||
// API calls: network only
|
||||
if (e.request.url.includes("/api/")) return;
|
||||
// Static: cache first
|
||||
e.respondWith(
|
||||
caches.match(e.request).then(cached => cached || fetch(e.request))
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user