26 lines
443 B
Go
26 lines
443 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"streamin-be/app/database"
|
|
"streamin-be/app/router"
|
|
|
|
"github.com/rs/cors"
|
|
)
|
|
|
|
func main() {
|
|
database.InitDB()
|
|
router.InitRouter()
|
|
|
|
handler := cors.New(cors.Options{
|
|
AllowedOrigins: []string{"*"},
|
|
AllowedMethods: []string{"POST, GET, OPTIONS"},
|
|
AllowedHeaders: []string{"*"},
|
|
}).Handler(http.DefaultServeMux)
|
|
|
|
fmt.Println("🚀 running on :8080")
|
|
http.ListenAndServe(":8080", handler)
|
|
}
|