How to display a file instead of downloading it with react

168 views Asked by At

I use nx to build react apps and deploy it to vercel. I am able to generate .well-known folder with stellar.toml file inside it and then reference it in index.html like this:

<!DOCTYPE html>
<html
    lang="en"
    clasName="h-full">
    <head>
        ...

        <meta
            name="viewport"
            content="width=device-width, initial-scale=1" />
        <link
            rel="stellar.toml file"
            href="%PUBLIC_URL%/.well-known/stellar.toml" />

        ...

    </head>
    <body className="h-full">
        <div id="root"></div>
    </body>
</html>

The deployment is successful, but any time I want to display the file when entering {domain}/.well-known/stellar.toml it's prompting me to download it instead of displaying it in the tab.

I am using react-router also in case it's better to do it with react-router. Is there a way to just display it instead of the download prompt?

0

There are 0 answers