mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-28 01:48:51 +05:00
bug fixes
This commit is contained in:
18
main.go
18
main.go
@@ -18,7 +18,9 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := godotenv.Load(); err != nil { _ = err }
|
||||
if err := godotenv.Load(); err != nil {
|
||||
_ = err
|
||||
}
|
||||
|
||||
cfg := config.New()
|
||||
|
||||
@@ -42,12 +44,11 @@ func main() {
|
||||
authHandler := appHandlers.NewAuthHandler(authService)
|
||||
movieHandler := appHandlers.NewMovieHandler(movieService)
|
||||
tvHandler := appHandlers.NewTVHandler(tvService)
|
||||
favoritesHandler := appHandlers.NewFavoritesHandler(favoritesService)
|
||||
favoritesHandler := appHandlers.NewFavoritesHandler(favoritesService, cfg)
|
||||
docsHandler := appHandlers.NewDocsHandler()
|
||||
searchHandler := appHandlers.NewSearchHandler(tmdbService)
|
||||
categoriesHandler := appHandlers.NewCategoriesHandler(tmdbService)
|
||||
playersHandler := appHandlers.NewPlayersHandler(cfg)
|
||||
webtorrentHandler := appHandlers.NewWebTorrentHandler(tmdbService)
|
||||
torrentsHandler := appHandlers.NewTorrentsHandler(torrentService, tmdbService)
|
||||
reactionsHandler := appHandlers.NewReactionsHandler(reactionsService)
|
||||
imagesHandler := appHandlers.NewImagesHandler()
|
||||
@@ -75,10 +76,7 @@ func main() {
|
||||
|
||||
api.HandleFunc("/players/alloha/{imdb_id}", playersHandler.GetAllohaPlayer).Methods("GET")
|
||||
api.HandleFunc("/players/lumex/{imdb_id}", playersHandler.GetLumexPlayer).Methods("GET")
|
||||
api.HandleFunc("/players/vibix/{imdb_id}", playersHandler.GetVibixPlayer).Methods("GET")
|
||||
|
||||
api.HandleFunc("/webtorrent/player", webtorrentHandler.OpenPlayer).Methods("GET")
|
||||
api.HandleFunc("/webtorrent/metadata", webtorrentHandler.GetMetadata).Methods("GET")
|
||||
api.HandleFunc("/players/vibix/{imdb_id}", playersHandler.GetVibixPlayer).Methods("GET")
|
||||
|
||||
api.HandleFunc("/torrents/search/{imdbId}", torrentsHandler.SearchTorrents).Methods("GET")
|
||||
api.HandleFunc("/torrents/movies", torrentsHandler.SearchMovies).Methods("GET")
|
||||
@@ -154,10 +152,12 @@ func main() {
|
||||
}
|
||||
|
||||
port := cfg.Port
|
||||
if port == "" { port = "3000" }
|
||||
if port == "" {
|
||||
port = "3000"
|
||||
}
|
||||
|
||||
if err := http.ListenAndServe(":"+port, finalHandler); err != nil {
|
||||
fmt.Printf("❌ Server failed to start: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user