Idiomatic way to know if the server is enabled

Hi! I want to add to the supervision tree some stuff only if the server is enabled. Is

Application.get_env(:phoenix, :serve_endpoints)

the idiomatic way to check that? Or is there a more encapsulated API?

1 Like

This works, but there’s also a proper api: