2022-04-21 15:14:49 -03:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
|
2023-09-23 17:02:55 +00:00
|
|
|
handler "github.com/felipemarinho97/torrent-indexer/api"
|
|
|
|
|
"github.com/felipemarinho97/torrent-indexer/cache"
|
2022-04-21 15:14:49 -03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2023-09-23 17:02:55 +00:00
|
|
|
redis := cache.NewRedis()
|
|
|
|
|
indexers := handler.NewIndexers(redis)
|
|
|
|
|
|
2022-04-21 15:14:49 -03:00
|
|
|
http.HandleFunc("/", handler.HandlerIndex)
|
2023-09-22 23:50:22 +00:00
|
|
|
http.HandleFunc("/indexers/comando_torrents", indexers.HandlerComandoIndexer)
|
2022-04-21 15:14:49 -03:00
|
|
|
|
|
|
|
|
err := http.ListenAndServe(":7006", nil)
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
}
|