Skip to content

global basepath #836

@dseynaev

Description

@dseynaev

It would be helpful to be able to specify a global base path e.g. as an argument to pr_run(), which would be taken into account by all routers including the documentation and spec urls.

I'm currently working around this by just creating an empty root router pr() and using pr_mount() to add my actual router under a base path. This is not a complete solution since I would also like to serve my documentation under that same base path.

I found options(plumber.apiPath), which looks like it's working, but the docs are actually served under http://127.0.0.1:5297/__docs__/

>  plumber::options_plumber(apiPath = "/x")
>  plumber::pr() %>% plumber::pr_run()
Running plumber API at http://127.0.0.1:5297
Running swagger Docs at http://127.0.0.1:5297/x/__docs__/

Metadata

Metadata

Assignees

No one assigned

    Labels

    theme: OpenAPIpertains to OpenAPItype: bugMaintainers have validated that it is a real bug in the project code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions