Hi everyone!
Is there a way to include a static file directly under an app domain root? For example https://my-app-domain.anvil.app/data.json
Thanks very much
Simon
Hi everyone!
Is there a way to include a static file directly under an app domain root? For example https://my-app-domain.anvil.app/data.json
Thanks very much
Simon
typically static assets
might be stored as:
theme assets
media objects
in a datatable
.to access the theme assets you can do
https://my-app-domain.anvil.app/_/theme/ data.json
linked docs:
https://anvil.works/docs/client/themes-and-styling#asset-file-url
it depends on the static asset I guess as to which one to chose…
Hey @stucork, thanks very much for the reply!
I am specifically interested about the asset being located directly in the domain root, the reason being that I would like to experiment with including a web manifest and this needs to be in the domain root. Similar to the fixed location of favicon.ico which I see Anvil has special support for as a “Logo” under “Titles and Logos”. Would I be correct in assuming that this is not possible at the moment?
Thanks!
I think (haven’t tried myself) that you can clone the repository to your pc, add a file to the root folder and push back to the server. The new file will sit there without problems.
But I think (again, haven’t tried myself) it will not be served as a static file because the Anvil server only serves static files from the _/theme
directory, as suggested by @stucork .
I have the same issue but for different case. A file need to be added into the root folder so loader.io can stress test the app
Thanks for the tip. I gave this a try though and unfortunately I got a message to the effect of “app not found”