Skip to content

Commit

Permalink
add the rest endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso committed Jun 13, 2024
1 parent 197d33b commit 5dab1f6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ func NewServer(cfg Config) *Server {
func (s *Server) Run(_ context.Context) error {
r := chi.NewRouter()
r.Use(middleware.Logger)
r.Get(api+"/get/secret", func(w http.ResponseWriter, r *http.Request) {
r.Get(api+"/secret", func(w http.ResponseWriter, r *http.Request) {
bitwarden.GetSecret()
_, _ = w.Write([]byte("welcome"))
})
r.Delete(api+"/secret", func(w http.ResponseWriter, r *http.Request) {
bitwarden.GetSecret()
_, _ = w.Write([]byte("welcome"))
})
r.Post(api+"/secret", func(w http.ResponseWriter, r *http.Request) {
bitwarden.GetSecret()
_, _ = w.Write([]byte("welcome"))
})
Expand Down

0 comments on commit 5dab1f6

Please sign in to comment.