add repository draft
This commit is contained in:
@@ -5,7 +5,7 @@ create table public.locations
|
||||
);
|
||||
|
||||
|
||||
create table public.temp_data
|
||||
create table public.meteo_data
|
||||
(
|
||||
id serial primary key,
|
||||
|
||||
|
||||
@@ -3,14 +3,19 @@ package main
|
||||
import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"servicea/internal/app"
|
||||
"servicea/internal/domains/meteo"
|
||||
"servicea/internal/router"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pool := app.NewPGXPool("postgres://developer:secret@localhost:5432/meteologica?sslmode=disable")
|
||||
|
||||
mux := router.SetupRoutes()
|
||||
|
||||
meteoHandler := meteo.NewHandler()
|
||||
meteoRepo := meteo.NewPGXRepo(pool)
|
||||
meteoService := meteo.NewService(meteoRepo)
|
||||
meteoHandler := meteo.NewHandler(meteoService)
|
||||
meteo.RegisterRoutes(mux, meteoHandler)
|
||||
|
||||
slog.Info("server starting on :8080")
|
||||
|
||||
Reference in New Issue
Block a user