Custom api endpoint implementation

Hello everyone,

I am trying to creat my own little endpoint in portainer local installation. I want to have something like that:

that returns a simple json

I did exactly the same as the user endpoint implementation (http://localhost:9000/api/users), creating my own handler inside the api/http/handler directory, and also I linked the handler in the main handler.go file

case strings.HasPrefix(r.URL.Path, "/api/custom-end-point"):
http.StripPrefix("/api", h.CustomEndPointHandler).ServeHTTP(w, r)

Then I run (to compile the new go files)

yarn start

Everything seems to compile without any errors, and then the portainers starts

The problem I am having is that the endpoint response with: 404 page not found all the time, seems like the call is not reaching the server.

Question :
Do you have any suggestions how to make the endpoint respond to the call? Is running yarn star just enough or there is a need of an extra step?