feat: Initial prototype

This commit is contained in:
abdus committed 2023-03-04 18:56:03 +01:00
commit 415a6c8337
9 files changed
+578

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
package main
import (
"os"
"github.com/rs/zerolog/log"
"prayertimes/internal/api"
"prayertimes/internal/scrapeutils"
"prayertimes/pkg/diyanet"
)
func main() {
port, ok := os.LookupEnv("PORT")
if !ok {
port = "8000"
}
services := newServices()
app := api.New(services)
err := app.Listen(":" + port)
if err != nil {
log.Fatal().Err(err).Msg("exit with an error")
}
}
func newServices() api.Services {
d := diyanet.Diyanet{
FetcherFunc: scrapeutils.GetParsed,
}
return api.Services{
PrayerTimesProvider: d,
}
}