Hello,
I was looking into the feasibility of using Strapi application to be deployed in a sub path instead of sub domain. This seems to be possible with minimal changes and would like to see if this can be proposed to expand the usage of strapi.
Currently, strapi configuration for admin and server allow for providing relative path for the url (even though the recommendation is to use fully qualified url)
On providing the relative path for server, this updates most of the url with server sub path. The issues I ran into were
-
/init and /project type path were not under the sub-path. Found the admin-api to have a commented out line for admin that was just replaced with the sub-path. That worked.
-
Content preview:
a. The issue is with providing url the server config, the content is uploaded to the right path with the subpath in the folder structure, but the preview is broken, because koastatic is referencing from the base url instead of the subpath. Can either resolve this by adding koa-mount to ignore the subpath
OR (more brute-force approach)
Update the upload and data-transfer to add the subpath to all the uploadPath and assetDirectory creation to upload it to that location.
These two changes provide strapi out of the box support for relative path.