Skip to content

Commit

Permalink
update MainApp.R for serverless version
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Nov 22, 2024
1 parent f1cbc64 commit d9ed791
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/MainApp.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
app <- function() {
ui <- fluidPage(
useShinyjs(),
includeScript(system.file("www/download.js", package = "bs")),
includeScript("www/download.js"),
tags$head(
tags$script(src = "https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js"),
tags$script(src = "https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"),
Expand Down
6 changes: 6 additions & 0 deletions bs/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,12 @@ elongate_col <- function(col, l) {
}
}

# TODO: for dataframe
# Check that enough memory is available
# Add own function for seq which also checks the size and memory usage
# Set a limit for the size of the imported data
# Set a limit for the number of results in the results list.
# Set a memory limit for the results list
DataFrame <- function(...) {
columns <- list(...)
s <- substitute(list(...))
Expand Down
6 changes: 6 additions & 0 deletions bs/inst/tinytest/Assumptions.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# TODO: Tests
# Add github actions for the test
# Add test for diagnostic plot
# add tests for utils functions
# add tests for plotting internally
# add tests for lc50 internally
library(shinytest2)
library(tinytest)
app <- bs::app()
Expand Down
11 changes: 8 additions & 3 deletions deploy_serverless_app.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# TODO: deploy app to GitHub.io
# All those copying etc. should be done within the github workflow
# Find a solution to show the static html files of the documentation
# automatically copy the www folder to the folder app
# automatically copy the system.files to the folder app
# automatically parse the upload filed as the environment variable is ignored?
files <- list.files("/home/konrad/Documents/Biostats/bs/R/", pattern = ".R", full.names = TRUE)
file.copy(files, "/home/konrad/Documents/Biostats/app/", overwrite = TRUE)
# Replace the upload field
Expand Down Expand Up @@ -38,7 +44,6 @@ code <- code[2:(length(code) - 1)]
writeLines(code, con)
close(con)

setwd("/home/konrad/Documents/Biostats")
shinylive::export(appdir = "./app/", destdir = "docs", quiet = FALSE)
setwd("/home/konrad/Documents/Biostats/docs")
setwd("/home/konrad/Documents/Biostats/app")
shinylive::export(appdir = "./app/", destdir = "./app", quiet = FALSE)
httpuv::runStaticServer(".")

0 comments on commit d9ed791

Please sign in to comment.