How to expose website ownership verification files?

Hi friends,
We want to expose two files apple-app-site-association and assetlinks.json.
Both should appear under www.website-name.com/.well-known/
How we can achieve it?
We already used hooks in custom app like below and return the context.

website_route_rules = [
{"from_route": "/.well-known/assetlinks.json", 	"to_route": "android"},
{"from_route": "/.well-known/apple-app-site-association", 	"to_route": "ios"}
]

But issue is that both files should be content-type/json. But by this way both are plain text. This creates issue for website verification for deep linking.
Can anyone help how to expose these two files as json.
Is there a way using nginx? if yes then please can you help?

1 Like

Don’t think you need hooks here, put those files under www folder of your app(?)

I afraid no my friend, because frappe search for .htm file or folder with py and html file inside.

Also if that is even possible. how we will add .well-known/ path?

Create .well-known folder inside www and then put your file?

In www directory create a directory with name
.well-known

Within this directory, create/add your files