-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solveIf the issue only affects a very niche base of users and an easily implemented workaround can solvesource: core:strapiSource is core/strapi packageSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
Description
Bug report
I'm unable to change the directory of the public path.
Describe the bug
According to this documentation you're able to overwrite the default path of the public directory. Changing it in config/middlewares.js to:
{
name: 'strapi::public',
config: {
path: env('PUBLIC_DIRECTORY', '/data/public'),
},
},
does nothing to the public path.
Steps to reproduce the behavior
- Change the public path in
config/middlewares.jsby changingstrapi::publicto an object with a config and a path property - Restart the server
- Upload something
- Can't find the uploaded file in the
testdirectory but you are able to find it inpublic/uploads
Expected behavior
I expect the public directory and the content that I upload to be set to the path value I specify in config/middlewares.js.
Code snippets
Example of the change to strapi::public in config/middlewares.js.
{
name: 'strapi::public',
config: {
path: './test',
},
},
System
- Node.js version: 14.18.2
- NPM version: 6.14.15
- Strapi version: 4.0
- Database: SQLite
- Operating system: Debian GNU/Linux 10 (buster)
Additional context
Trying to get Strapi v4 working on Render.com. Changing the public path is the only thing holding me back using Strapi v4 on an ephemeral environment.
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solveIf the issue only affects a very niche base of users and an easily implemented workaround can solvesource: core:strapiSource is core/strapi packageSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members