pedestal

dangercoder 2020-09-23T09:33:46.000500Z

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

dangercoder 2020-09-23T09:34:12.001Z

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

dangercoder 2020-09-23T09:34:25.001300Z

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

dangercoder 2020-09-23T09:36:16.001700Z

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

souenzzo 2020-09-23T13:23:11.004500Z

@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)

dangercoder 2020-09-23T13:27:41.004800Z

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

isak 2020-09-23T17:32:54.009400Z

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)