Is there any way to share the data (.SQL files, .R files) between the application and the API?


#1

...I have the application and the API of that application as two different projects in two different folders. I would like to know if there is any way to store the data files (stored procedures, .sql files) in one place instead of moving the files every time we update the data or stored procedures.

Any comments or suggestions are highly appreciated.


#2

That's interesting, I am thinking about the same since I recently started a project with a similar setup. I have no solution (yet) but I have these ideas so far:

  • use a symbolic link in the shiny app folder that references the data files in the API folder (or vice versa)
  • make them part of a (new) package and use system.file get the full path in both the app/API to load the files

would also like to hear other people's suggestions


#3

Great, thank you for the ideas. And one more doubt. Is there anyway to get multiple outputs from one end point instead of multiple endpoints?

I am able to get 3 outputs (two data tables and one text) from 3 endpoints but I want all 3 outputs from one endpoint. Is it possible?


#4

not sure about that. What package are you using to create your API?


#5

I am using Plumber package


#6

The output section in the documentation might be helpful


#7

Hi, where are you publishing these to?


#8

I don't know about @bharath222, but I am publishing the app and API (plumber) on rstudio connect