Add recovery middleware to handle panics and log errors

This commit is contained in:
2025-04-20 23:45:44 -05:00
parent bd455f1782
commit 9fd027fcda
2 changed files with 29 additions and 1 deletions

View File

@ -36,6 +36,7 @@ var startCmd = &cobra.Command{
// Create middleware stack
stack := middleware.CreateStack(
middleware.Recovery(), // Add recovery middleware first to catch all panics
middleware.SecureHeaders,
middleware.Logging,
middleware.MaxBodySize(1024*1024), // 1MB size limit
@ -74,4 +75,4 @@ func init() {
// Add the command to the root command
rootCmd.AddCommand(startCmd)
}
}