changes in sockets and terminal development

This commit is contained in:
2025-04-21 14:59:25 +05:30
parent 305650925e
commit 86dcfa2a4a
11 changed files with 1357 additions and 9 deletions

View File

@@ -0,0 +1,31 @@
package api
import (
"net/http"
"github.com/arnab-afk/monaco/internal/api/handlers"
)
// SetupRoutes configures all API routes
func SetupRoutes() http.Handler {
// Create a new handler
h := handlers.NewHandler()
// Create a new router
mux := http.NewServeMux()
// Apply middleware to all routes
var handler http.Handler = mux
handler = handlers.RecoveryMiddleware(handler)
handler = handlers.LoggingMiddleware(handler)
handler = handlers.CORSMiddleware(handler)
// Register routes
mux.HandleFunc("/submit", h.SubmitHandler)
mux.HandleFunc("/status", h.StatusHandler)
mux.HandleFunc("/result", h.ResultHandler)
mux.HandleFunc("/queue-stats", h.QueueStatsHandler)
mux.HandleFunc("/health", h.HealthCheckHandler)
return handler
}