Add recovery middleware to handle panics and log errors
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user