diff --git a/NEWS b/NEWS index baa80932..63af1b44 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ shiny-server 1.5.20 then deploy the generated index.html, index_files directory, and the source index.qmd together to be served by Shiny Server. +* Fix bug where Shiny for Python apps did not work for `app_dir` directives. + shiny-server 1.5.19 -------------------------------------------------------------------------------- diff --git a/lib/router/router.js b/lib/router/router.js index 9fa01af8..aea577ac 100644 --- a/lib/router/router.js +++ b/lib/router/router.js @@ -247,13 +247,15 @@ function SingleAppRouter(appdir, runas, prefix, logDir, settings) { var app = _.find(files, function(entry) { return /^server\.r$/i.test(entry); }); - var singleApp = _.find(files, function(entry) { return /^app\.r$/i.test(entry); }); var rmd = _.find(files, function(entry) { return /\.[rq]md$/i.test(entry); }); + var pyApp = _.find(files, function(entry) { + return /^app\.py$/.test(entry); + }); var indexRmd = _.find(files, function(entry) { if (/^index\.[rq]md$/i.test(entry)){ return entry; @@ -296,6 +298,8 @@ function SingleAppRouter(appdir, runas, prefix, logDir, settings) { .done(); return true; } + } else if (pyApp) { + appSpec.settings.mode = "shiny-python"; } else{ // No app found. }