mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-07-25 20:19:45 +00:00
16 lines
485 B
Go
16 lines
485 B
Go
package http
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/nextlevelbuilder/goclaw/internal/i18n"
|
|
"github.com/nextlevelbuilder/goclaw/pkg/protocol"
|
|
)
|
|
|
|
// RegisterAPINotFoundRoute keeps unknown /v1/* paths in the structured API envelope.
|
|
func RegisterAPINotFoundRoute(mux *http.ServeMux) {
|
|
mux.HandleFunc("/v1/", func(w http.ResponseWriter, r *http.Request) {
|
|
writeError(w, http.StatusNotFound, protocol.ErrNotFound, i18n.T(extractLocale(r), i18n.MsgNotFound, "API route", r.URL.Path))
|
|
})
|
|
}
|