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,38 @@
package main
import (
"log"
"net/http"
"os"
"time"
"github.com/arnab-afk/monaco/internal/api"
)
func main() {
// Configure logging
log.SetFlags(log.LstdFlags | log.Lshortfile)
log.SetOutput(os.Stdout)
log.Println("Starting Monaco code execution backend...")
// Initialize router with all routes
router := api.SetupRoutes()
// Start the server
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
server := &http.Server{
Addr: ":" + port,
Handler: router,
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
IdleTimeout: 120 * time.Second,
}
log.Printf("Server started at :%s", port)
log.Fatal(server.ListenAndServe())
}