going prod step-by-step
This commit is contained in:
@@ -202,6 +202,14 @@ func (s *Server) handleStatus(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Server) handleHello(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusOK, map[string]string{
|
||||
"message": "Close the world, .txen eht nepO",
|
||||
"author": "Yigid BALABAN <hey@yigid.dev>",
|
||||
"authorHomepage": "https://yigid.dev/",
|
||||
})
|
||||
}
|
||||
|
||||
func writeJSON(w http.ResponseWriter, status int, data interface{}) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(status)
|
||||
|
||||
@@ -23,6 +23,7 @@ func NewRouter(cfg *config.Config, userMgr *user.Manager, deployMgr *deploy.Mana
|
||||
mux.Handle("DELETE /api/v1/auth", adminAuth(http.HandlerFunc(server.handleAuthDelete)))
|
||||
mux.Handle("POST /api/v1/deploy", userAuth(maxBytes(http.HandlerFunc(server.handleDeploy))))
|
||||
mux.HandleFunc("GET /api/v1/status", server.handleStatus)
|
||||
mux.HandleFunc("GET /api/hello", server.handleHello)
|
||||
|
||||
return LoggingMiddleware(logger)(mux)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user