Fork me on GitHub
#pedestal
<
2020-09-23
>
dangercoder09:09:46

How are admin endpoints handled in pedestal? I am used to exposing theese endpoints on a different port than the "public facing api".

dangercoder09:09:12

Does anyone have an example? E.g I want to expose port 5000 for admin-endpoints (health/metrics) and 8080 for my "regular api".

dangercoder09:09:25

I guess it depends on which web-server is used also..

dangercoder09:09:16

In e.g Jetty", this is possible with multiple connectors

souenzzo13:09:11

@jarvinenemil i do that in 2 ways: - I have multiple instances of pedestal. My current app has 4 different ports/instances. - I gave up default-interceptors. Now I have a custom interceptors set where things like sessions and csrf-token are after the routing (to it can be applied just for some routes)

dangercoder13:09:41

so pedestal starts several web-servers? or can it re-use the same instance? 😄

isak17:09:54

If you really want to do it on a different port, I think you need more than one service-map that is http/started . If it were me though, I would just use an /admin "route folder", where all the routes get an interceptor added that ensures admin access. (But I don't have an example app to show)