Don't know how to change base URL
See original GitHub issueI want to serve all platformatic
content with a prefix of /v1
(for instance) so I can set up routing properly. Right now each table is served in the root directory, e.g. table users
is in /users
; not good for routing.
I have tried to set up a base path of /v1
in several ways but no luck.
- I tried to set
basePath
in Swagger config. - I have also tried to set up an
openapi
object insidecore
, with an attribute:"servers": [{"url": "/v1"}]
. In this case I get an error: “Failed to load API definition”. Full configuration below. - I don’t see any config parameters in Platformatic itself to set up the
basePath
(orbaseUrl
).
What am I missing? Thanks in advance!
Full platformatic.db.json
:
{
"server": {
"hostname": "0.0.0.0",
"port": "3042",
"cors": {
"origin": "{PLT_SERVER_CORS_ORIGIN}"
}
},
"core": {
"connectionString": "{PLT_DATABASE_CONNECTION_URL}",
"graphql": false,
"openapi": {
"servers": [{
"url": "/v1"
}]
}
},
"migrations": {
"dir": "./migrations"
}
}
Note: setting "openapi": {}
works but again everything is served from the base path /
.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How can I change the existing base URL of Artifactory - JFrog
Navigate to Admin -> Configuration-> General Configuration-> General settings -> change Custom Base URL to a new url.
Read more >Change the default base url for axios - Stack Overflow
Change the default base url for axios · 2. you can change the base url of an axios instance by setting: this.$axios. ·...
Read more >How do I change the Base URL in Drupal 7?
To update - I've changed the url using base url and RewriteCond etc in htaccess and settings.php. It has broken all of the...
Read more >how to change base url - Atlassian Community
On Cloud you don't change the base url. You register an instance with a name and that's the name. If you are on...
Read more >Drupal configuration on non root url (how to change $base_url)?
1 Answer 1 · Find the line that reads # RewriteBase /drupal · Uncomment it by deleting the "#" RewriteBase /drupal · Edit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should add a prefix in the config but not inside server, the
prefix
should be limited to the openapi routes.I recommend we add a
prefix
option somewhere for all the OpenAPI routes - this issue is not really about the OpenAPI definition but on the route definition.