feat: Initial prototype
This commit is contained in:
commit
415a6c8337
9 files changed
+578
No files matched your search
@@ -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,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user