mirror of
https://github.com/dnote/dnote
synced 2026-03-15 06:55:49 +01:00
23 lines
450 B
Go
23 lines
450 B
Go
package controllers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/dnote/dnote/pkg/server/app"
|
|
)
|
|
|
|
// NewHealth creates a new Health controller.
|
|
// It panics if the necessary templates are not parsed.
|
|
func NewHealth(app *app.App) *Health {
|
|
return &Health{}
|
|
}
|
|
|
|
// Health is a health controller.
|
|
type Health struct {
|
|
}
|
|
|
|
// Index handles GET /
|
|
func (n *Health) Index(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusOK)
|
|
w.Write([]byte("ok"))
|
|
}
|