Skip to content
Snippets Groups Projects
Commit 0f8f01ef authored by Ruben van Dijk's avatar Ruben van Dijk
Browse files

Added index.html.

parent 746ca78d
Branches
No related tags found
1 merge request!7Added index.html.
......@@ -10,6 +10,7 @@ RUN Rscript -e "renv::restore()"
FROM base
COPY --from=libraries /usr/local/lib/R/site-library /usr/local/lib/R/site-library
COPY index.html .
COPY code.R .
RUN Rscript code.R test
CMD ["Rscript", "code.R", "server"]
......@@ -171,7 +171,12 @@ app <- Application$new()
app$add_get(
path = "/",
FUN = function(.req, .res) {
dir.create(foldername[[1]])
if(length(.req$parameters_query)==0) {
.res$set_content_type("text/html; charset=utf-8")
.res$set_body(read_file("index.html"))
return()
}
dir.create(foldername[[1]])
response <- doId(.req$parameters_query)
response <- map(response, function(input) {
return(ggplotly(input))
......@@ -196,7 +201,7 @@ app$add_static("/libdir", "libdir")
backend <- BackendRserve$new()
swimmerData <- tryCatch(
{
df <- read.table(file='swimmerId.txt',header=FALSE, sep='=',col.names=c('Key','Value'))
df <- read.table(file= 'swimmerId.txt', header=FALSE, sep='=', col.names=c('Key', 'Value'))
output <- list()
for (row in seq_len(nrow(df))) {
output[[df$Key[row]]] <- df$Value[row]
......
<form method="get">
SwimmerID: <input type="text" inputmode="numeric" pattern="[0-9]*" name="id"><br>
dates to drop: <input type="text" name="dates_to_drop"><br>
<input type="submit" value="Submit">
</form>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment