More complex APIs: Multiple endpoints with plumber ================================================== To specify multiple end-points in your plumber API, you simply need to decorate multiple functions with routing comments. An example from the plumber documentation is the following, which allows you to ``GET`` an estimate of the mean of the normal distribution given a sample size, and ``POST`` two numbers (``a`` and ``b``) and receive back the sum. The source code for this API is: .. literalinclude:: plumber_basic_example_myapi.R Once you have configured your API in Faculty (see :ref:`plumber`), you can query your API from the command line of your development server: .. code-block:: bash curl localhost:8000/mean We can pass parameters in our API call, as well: .. code-block:: bash curl "localhost/mean?samples=10000" And we can query our second endpoint: .. code-block:: bash curl \ -H "Content-Type: application/json" \ --data '{"b": 3, "a": 5}' \ localhost:8000/sum