Shiny app not working

Aperta
#68 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
r
Ambito
api, backend

Direzione di ricerca

Reproduce the issue with the R example, first checking the @shiny /devApp endpoint and then the api_shiny('/ui/', ...) pipeline through api_run(). Compare the working echo endpoint with the Shiny responses and verify whether the @shiny tag is available in autocomplete; done means the Shiny endpoint runs without 404 or Internal Server Error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hello,

Let me start by saying I think it's great what's possible in this new version of Plumber!

I was particularly interested in running a Shiny app through the API, but unfortunately I cannot seem to make this work. Below is my (hopefully) reproducible example

#* Echo the parameter that was sent in
#*
#* @get /echo/<msg>
#*
#* @param msg:string The message to echo back.
#*
function(msg) {
  list(
    msg = paste0("The message is: '", msg, "'")
  )
}

#* @shiny /devApp
shiny::shinyAppDir(system.file("examples-shiny", "01_hello", package = "shiny"))

When I now click the Run API button in R Studio, the server starts, and the echo endpoint is working. However, if I navigate to the devApp endpoint I get {"error":"404 - Resource Not Found"}

Also the @shiny tag is not suggested in autocomplete and seems to be absent from the package

When I tried running

api() |>
  api_shiny(
    "/ui/",
    shiny::shinyAppDir(
      system.file("examples-shiny", "01_hello", package = "shiny")
    )
  ) |>
  api_run()

This did initially work when I navigated to the UI endpoint. However, now it's also broken giving me Internal Server Error (I tried installing the dev version and the the original one again so maybe that's the reason here?)

Thanks again for creating this new version!
PJ

Lingua principale
R
Stelle
119
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di posit-dev/plumber2

Tutte le issue di posit-dev/plumber2

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.