-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Better basePath support #914
Copy link
Copy link
Closed
Labels
RESTIssues related to @loopback/rest package and REST transport in generalIssues related to @loopback/rest package and REST transport in generalbugdeveloper-experienceIssues affecting ease of use and overall experience of LB usersIssues affecting ease of use and overall experience of LB usersneeds docneeds grooming
Metadata
Metadata
Assignees
Labels
RESTIssues related to @loopback/rest package and REST transport in generalIssues related to @loopback/rest package and REST transport in generalbugdeveloper-experienceIssues affecting ease of use and overall experience of LB usersIssues affecting ease of use and overall experience of LB usersneeds docneeds grooming
Currently, you can set a
spec.basePathat the top-level of your spec, but it does not cascade down as expected to all the endpoints in your app. To get abasePathto have an effect, we must pass in a partialControllerSpecfor each controller, negating the benefits of describing something with a base path. I'd expect each endpoint under the primary document to inherit this base path.In addition, no amount of config will seem to let us put the swagger docs under this
basePathas well, since it's hardcoded inrest-server.tsto only serve from the root.The
basePathat the top-level openapi spec seems like a good candidate for defining this, but also maybe providing a general "mount path" for the application, that it's aware it's not at the context root.The only workaround we see currently is to have a rewriting proxy server that will modify requests coming in to remove a context root, and to modify outgoing requests to add a context root, but this seems ... inefficient :)