-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with static app and LocalFileAdapter #2481
Comments
I've checked the app-static package and it seems that this is the expected behaviour and not a bug: keystone/packages/app-static/index.js Line 26 in faa57f3
So my question is... what's the right way to config the LocalFileAdapter?
btw, I'm using docker and I need this folder to persist between docker restars so it must be mapped to a local volume Thanks in advance! |
Related issue: #1823 |
What happens if you use |
It's the same... I understand the behavior of the Static App is correct and I finally set up the local file adapter to save the files in a different folder and set up nginx in production to serve that folder as static content. While in development I use express.static: module.exports = {
keystone,
apps,
configureExpress: app => {
app.set('trust proxy', 1);
isDev && app.use('/uploads', express.static('uploads'));
}
}; Maybe there is a better way but for the time being this works for me. |
BugreportDescribe the
bugI have a keystone app with a StaticApp configured to serve files located on the public folder on the root of my project:
and a LocalFileAdapter configured to store files on a subdirectory of the static app path:
This setup works fine on development mode but in production mode when the app is built the contents of the root public folder are copied to
dist/public
and thats the folder served by the keystone server... so when a file is uploaded using the admin UI it goes through the LocalFileAdapter to thepublic
folder on the root of my project so I get a 404 when I try to access the file using the public path URL because the file does not exist indist/public
.To Reproduce
Explained above.
System information
The text was updated successfully, but these errors were encountered: