streamin-be/main.go

26 lines
443 B
Go
Raw Permalink Normal View History

2026-04-23 04:02:18 +00:00
package main
import (
"fmt"
"net/http"
"streamin-be/app/database"
"streamin-be/app/router"
2026-04-23 05:01:50 +00:00
"github.com/rs/cors"
2026-04-23 04:02:18 +00:00
)
func main() {
database.InitDB()
router.InitRouter()
2026-04-23 05:01:50 +00:00
handler := cors.New(cors.Options{
AllowedOrigins: []string{"*"},
AllowedMethods: []string{"POST, GET, OPTIONS"},
AllowedHeaders: []string{"*"},
}).Handler(http.DefaultServeMux)
2026-04-23 04:02:18 +00:00
fmt.Println("🚀 running on :8080")
2026-04-23 05:01:50 +00:00
http.ListenAndServe(":8080", handler)
2026-04-23 04:02:18 +00:00
}