Hi,
As a first-time user of plumber2, I got stuck for quite a while when trying to
set up a minimal API using:
plumber2::create_server_yml("R/api.R")
plumber2::api("_server.yml")
Project structure:
test_plumber/
├─ Dockerfile
├─ _server.yml
├─ R/
│ └─ api.R
When R/api.R is empty, calling api("_server.yml") fails with the following
Error in seq_len(which(grepl("^(?!#('|\\*))", lines, perl = TRUE))[1] - 1) :
argument must be coercible to a non-negative integer
The error is not very informative and makes it hard for new users to understand what is wrong. In this case, the root cause is simply that R/api.R does not define any routes.
It might be helpful to return a clearer error message to improve the experience for new users.
Thanks for the great work on plumber2 !
Hi,
As a first-time user of plumber2, I got stuck for quite a while when trying to
set up a minimal API using:
Project structure:
When
R/api.Ris empty, callingapi("_server.yml")fails with the followingThe error is not very informative and makes it hard for new users to understand what is wrong. In this case, the root cause is simply that
R/api.Rdoes not define any routes.It might be helpful to return a clearer error message to improve the experience for new users.
Thanks for the great work on
plumber2!