GoogleCloudPlatform / app-gradle-plugin

The library has moved to https://github.com/GoogleCloudPlatform/appengine-plugins/tree/main/app-gradle-plugin
Apache License 2.0
153 stars 40 forks source link

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

Closed sanderploegsma closed 2 years ago

sanderploegsma commented 5 years ago

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?

loosebazooka commented 5 years ago

@ludoch @eamonnmcmanus any ideas?

loosebazooka commented 5 years ago

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

sanderploegsma commented 5 years ago

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.

JoeWang1127 commented 2 years ago

close as not planned