+1
-1
cmd/main.go
+1
-1
cmd/main.go
+10
-2
internal/app/app.go
+10
-2
internal/app/app.go
···
2
2
3
3
import (
4
4
"database/sql"
5
-
"fmt"
6
5
"log/slog"
7
6
"net/http"
8
7
"time"
···
34
33
Handler: router,
35
34
}
36
35
36
+
// actorStore := actor.NewStore(s.db)
37
+
// actorHandler := actor.NewHandler(actorStore)
38
+
// actorHandler.RegisterRoutes()
39
+
37
40
router.HandleFunc("/healthcheck", func(w http.ResponseWriter, r *http.Request) {
38
41
w.WriteHeader(http.StatusOK);
39
-
fmt.Fprintf(w, "reporting for duty")
42
+
w.Write([]byte("reporting for duty"))
43
+
})
44
+
45
+
router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
46
+
w.WriteHeader(http.StatusOK)
47
+
w.Write([]byte("hello world"))
40
48
})
41
49
42
50
s.logger.Info("app server started")
+17
internal/services/actor/routes.go
+17
internal/services/actor/routes.go
···
1
+
package actor
2
+
3
+
import "github.com/gorilla/mux"
4
+
5
+
type ActorStore interface {}
6
+
7
+
type Handler struct {
8
+
store ActorStore
9
+
}
10
+
11
+
func NewHandler(store ActorStore) *Handler {
12
+
return &Handler{store}
13
+
}
14
+
15
+
func (h *Handler) RegisterRoutes(router *mux.Router) {
16
+
router.HandleFunc("/login", nil).Methods("POST")
17
+
}
+11
internal/services/actor/store.go
+11
internal/services/actor/store.go