Server directory structure and streaming optimization

This commit is contained in:
2025-01-28 01:17:30 +01:00
parent 2674bc6c20
commit 40954e1f52
5 changed files with 176 additions and 153 deletions
+32
View File
@@ -0,0 +1,32 @@
package main
import (
"fmt"
"log"
"os"
"github.com/joho/godotenv"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"touch-programming.hazemkrimi.tech/internal/handlers"
)
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading environment!")
}
PORT := os.Getenv("PORT")
if len(PORT) == 0 {
PORT = "8080"
}
ech := echo.New()
ech.Use(middleware.CORS())
ech.GET("/generate", handlers.Generate)
ech.Logger.Fatal(ech.Start(fmt.Sprintf(":%s", PORT)))
}