Determine whether code is being run as part of a plumber API

I am looking for a reliable way of determining if code is being run "under" plumber. Something like what I believe shiny::isRunning() provides.


Referred here by rstudio/plumber

Set a global parameter or an option and check that in your code?

Or check if the frames stack includes runServer?

dump.frames(); "httpuv::runServer(host, port, self)" %in% names(last.dump);

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.