popup
This commit is contained in:
BIN
cmd/server/icon.ico
Normal file
BIN
cmd/server/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -44,8 +44,11 @@ func main() {
|
||||
log.Fatalf("Failed to start device manager: %v", err)
|
||||
}
|
||||
|
||||
// Channel de shutdown partagé entre main et le handler API
|
||||
shutdownChan := make(chan struct{})
|
||||
|
||||
// Create HTTP server with embedded files
|
||||
server := api.NewServer(deviceManager, hub, cfg)
|
||||
server := api.NewServer(deviceManager, hub, cfg, shutdownChan)
|
||||
mux := server.SetupRoutes()
|
||||
|
||||
// Serve embedded static files
|
||||
@@ -76,12 +79,17 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
// Wait for interrupt signal
|
||||
// Wait for interrupt signal or API shutdown request
|
||||
quit := make(chan os.Signal, 1)
|
||||
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
|
||||
<-quit
|
||||
|
||||
log.Println("Shutting down server...")
|
||||
select {
|
||||
case <-quit:
|
||||
log.Println("Signal received, shutting down...")
|
||||
case <-shutdownChan:
|
||||
log.Println("API shutdown requested, shutting down...")
|
||||
}
|
||||
|
||||
deviceManager.Stop()
|
||||
log.Println("Server stopped")
|
||||
}
|
||||
|
||||
BIN
cmd/server/resource.syso
Normal file
BIN
cmd/server/resource.syso
Normal file
Binary file not shown.
5
cmd/server/web/dist/index.html
vendored
5
cmd/server/web/dist/index.html
vendored
@@ -7,8 +7,9 @@
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
|
||||
<script type="module" crossorigin src="/assets/index-Ci4y1GIJ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B1UmG2DI.css">
|
||||
<script type="module" crossorigin src="/assets/main-CEFSEmZ6.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/api-C_k14kaa.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/main-CuAW62oI.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Reference in New Issue
Block a user