feat: integrate Mock Service Worker (MSW) for API mocking and testing
Currently just used for demo page
- Added MSW as a dependency in package.json.
- Configured MSW in the demo HTML to start the worker and handle API requests.
- Created mockServiceWorker.js to manage service worker lifecycle and request handling.
- Implemented browser.ts to set up the MSW worker with defined request handlers.
- Developed handlers.ts to simulate API responses and manage application state for testing.
diff --git a/webui/esbuild.go b/webui/esbuild.go
index b86b7d7..8f1fcfe 100644
--- a/webui/esbuild.go
+++ b/webui/esbuild.go
@@ -176,6 +176,9 @@
}
return nil
}
+ if strings.HasSuffix(path, "mockServiceWorker.js") {
+ return nil
+ }
if strings.HasSuffix(path, ".html") || strings.HasSuffix(path, ".css") || strings.HasSuffix(path, ".js") {
b, err := embedded.ReadFile(path)
if err != nil {