COVAIL / photon

RStudio Add-in to build Shiny apps utilizing the Electron framework
125 stars 25 forks source link

Is It possible to have ui.R and server.R instead of app.R #6

Closed Felixmil closed 4 years ago

Felixmil commented 4 years ago

Thanks for your great work, after many month talking with my company's IT and in the end, no server to host my shiny apps. I'll finally able to deliver the power of shiny apps to my colleagues.

Most of my apps are separated server.R and app.R. I tried building electron with those files but it doesn't seem to work (blank page when launching the app).

Is it theorically impossible or am I missing something else ?

Felixmil commented 4 years ago

Worked when using this in App.R.

ui <- source("ui.R",encoding = 'utf-8')
server <- source("server.R", encoding = "utf-8")

# Run the application 
shinyApp(ui = ui, server = server)

The code calls ui and server from different files then runs the app.