GoogleCloudPlatform / app-gradle-plugin

The library has moved to https://github.com/GoogleCloudPlatform/appengine-plugins/tree/main/app-gradle-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting <public-root> in appengine-web.xml does not work

sanderploegsma opened this issue · comments

According to the appengine-web.xml documentation it should be possible to set a root path for static files like this:

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <!-- ... -->
    <public-root>/static</public-root>
</appengine-web-app>

Which should make src/main/webapp/style.css available under project.appspot.com/static/style.css.

However, when I add the public-root setting, the resulting app.yaml does not have any directives for static files anymore, and the build/staged-app/__static__ folder is suddenly empty.

Am I missing something?

commented

from @ludoch

I think this is Work as intended. The customer has to put files under the static dir, and then the mapping works this work:
for a file under customer static/foo, it is served under project.appspot.com/foo

Right, reading the documentation again it seems I mixed up the file path and the URL path. You're correct, the public-root is used to denote the folder which contains the static files.

I was trying to do the inverse: prepend something to the URL path of static files, due to migrating an application and having to proxy specific paths from the old application. I therefore wanted to have my static files served under: example.com/some/path/style.css, without having to create the /some/path directory structure in my new application. From the looks of it, this isn't currently possible.

close as not planned