Comments (7)
Thanks for the quick reply! I think the info log message could be considered a bug given it ultimately points to a URL that doesn't work - perhaps an extra line in the docs section for hosting at a sub-path?
I gave that a whirl and it worked. Do you know if there are other paths that need adjusting to ensure that no resources get hosted at the root? I can see options for API etc. in the routes block, but I also see a paths
object used as part of the file upload mechanism (?) further down in the configuration? Ideally I need to find a way to scope every Payload resource (CSS/JS, routes...) to foo
so that it doesn't fight with the other apps
from payload.
Totally. IMO we really just need to enforce that the serverURL
itself does not contain a path - only protocol, domain, port. That would then solve the info log. Well, that and some improved docs of course. Thoughts?
The only routes that get mounted by Payload are the ones that you can customize through the routes
config property. Everything that Payload does Express-wise will be scoped accordingly so nothing outside of those routes will compete with your apps whatsoever. Including all statically served CSS, JS, etc. required by the admin panel.
The paths
property is actually no longer used and is left over in the config type. We will remove that - good eye!
from payload.
Good point regarding pedantics. We will keep an eye out for further requests and should be able to facilitate basePath
support in one way or another if it’s important to the community.
I say we keep this issue open until we can do the following:
- remove
paths
from config type - update docs to be more explicit about the above
- enforce that
serverURL
does not contain a path
We can take a stab at that stuff tomorrow!
from payload.
Closed with #28 .
from payload.
Upon further investigation it appears that the issue may lie with the API URL, as the page at e.g. /foo/admin
attempts to hit http://localhost:3000/api/users/me
as opposed to http://localhost:3000/foo/api/users/me
from payload.
Hey @joshhills!
This is actually not intended functionality, and there may be a way to do exactly what you’re looking to do with current functionality.
Can you try setting your routes.admin
to /cms/admin
and just leave your serverURL
equal to http://localhost:3000
?
If this works for your needs, we will make sure to update the docs accordingly!
from payload.
Yes, I think to be pedantic, "URL" can typically contain a path, so either a comment or splitting it into those individual fields (though that might be more boilerplate) should suffice. Support for a basePath
to automatically pre-pend the routes fields might be a good feature request if others also run into the same issue? Additionally, showing the default URLs in one place might be useful - I had to skip between docs pages to grab them all - unless I'm missing something.
RE other routes - good to know! From reading the docs on uploads, I gather that I can ensure that media uploads are scoped accordingly by making the staticURL
and staticDir
also contain /foo
in some way. I think it's very elegant that it's suggested that media be its own collection type (though you might want to include that in the npx setup alongside TODOs, I imagine it'll be necessary for most projects?).
I'll try setting them all, creating a collection with file uploads, and close with a final comment when it works?
from payload.
Related Issues (20)
- [3.0] - Plugin SEO - Clicking "choose existing" image crashes the frontend
- [3.0.0-beta.34] Error with Payload config validation on field "admin.meta"
- Missing "id" property in adminThumbnail's doc parameter
- Including getPayloadHMR in a NextJS app increases the bundle size significantly HOT 8
- dependency issue using localAPI in a sveltekit application HOT 2
- Not all props are being passed into custom view when `relationTo` is opened in a Drawer HOT 1
- Windows only: `generate:types` not working properly HOT 1
- Cannot resolve 'fs' when loading <ListView />
- Unable to save document with large text fields
- Sorting by an array field breaks the collection list view table
- Sorting by an array field breaks the collection list view table
- mimeType error with XML CSV HOT 1
- Where clause in GraphQL query does not work on fallbackLocale
- Lint is failing if ran on project init
- Navigation in the admin panel is broken if routes.admin is set to "/" HOT 3
- Unable to delete record from admin in postgres if collection has array field type
- Relationship field - 431 (Request Header Fields Too Large)
- Warning from yarn install HOT 1
- GraphQL doesn't work properly with turbopack
- CLI: when select `postgress` docker is setup with `mongo` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from payload.