Closed ssword closed 6 years ago
It is turned on with the flag that you've set. I don't understand why it's not working.
@ssword Have you figured out a fix? Does the same plumber router work in a local session?
__swagger__
. Two underscores before and after.
Good catch @trestletech! Thanks!
@ssword Does the route /__swagger__/
work for you?
@trestletech @schloerke , thanks for the reply. Sorry, I should have responded earlier. I was using __swagger__, (it is the markdown syntax that makes the typo). dunder before and after, and it didn't work. I have also tried the default one.
docker pull trestletech/plumber
docker run -rm -p 5000:8000 trestletech/plumber
Again, I can access /mean, and /sum, but /__swagger__/ still gives 404. I am running the docker in Google cloud platform, Centos 7, with port 5000 open. Is there any other information that I need t provide?
Can you provide the logs of your container on startup? That would emit info about whether or not Swagger is enabled.
Additionally, what Plumber/R version is your instance running?
@trestletech , thanks, here is the log:
[user@host ~]# docker run --rm -p 5000:8000 trestletech/plumber
ARGUMENT '/usr/local/lib/R/site-library/plumber/examples/04-mean-sum/plumber.R' __ignored__
R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> pr <- plumber::plumb(commandArgs()[4]); pr$run(host='0.0.0.0', port=8000)
Starting server to listen on port 8000
The run call there is missing swagger=TRUE
Stale docker image that needs rebuilding on the remote server?
@trestletech you are right, after adding swagger=TRUE to the default docker image, swagger UI is enabled. I will check my own docker file again, than you!
@trestletech , sorry, it's my bad, I was using the file with pr$run as command args instead of the original function file. I will close the issue.
First, really thanks for developing this package, it is super cool! I am trying to deploy plumber with docker, here is the last part of my dockerfile:
All the API functions running perfect, but I can't visit /__swagger/ page, 404 error. Do I need to configure something else? or it is not supported yet? Thanks.