server.R 636 Bytes
Newer Older
David Trudgian's avatar
David Trudgian committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# This example implements a simple file browser for accessing results.

library(shiny)
library(shinyFiles)

# Results are available in the directory specified by the outputDir environment
# variable, red by Sys.getenv

rootdir <- Sys.getenv('outputDir')


shinyServer(function(input, output, session) {

    # The backend for a simple file chooser, restricted to the
    # rootdir we obtained above.
    # See https://github.com/thomasp85/shinyFiles

    shinyFileChoose(input, 'files', roots=c('output'=rootdir), filetypes=c(''
                                                                             ,'txt'), session=session)

})