refactor: 重构项目结构
- 将server端相关依赖单独防止在server中
This commit is contained in:
10
interval/server/api/handler/health.go
Normal file
10
interval/server/api/handler/health.go
Normal file
@ -0,0 +1,10 @@
|
||||
package handler
|
||||
|
||||
import "net/http"
|
||||
|
||||
func Health(w http.ResponseWriter, _ *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
if _, err := w.Write([]byte("OK")); err != nil {
|
||||
http.Error(w, "failed to write response", http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user