2

Stemming off of this converstaion

https://galactictalk.org/d/2199-how-to-set-up-a-stellar-toml-file-with-reactjs-nodejs-stack/14

I have been able to identify that when using netlify to build a react app, that a .htaccess file is not used by netlify. Instead, the netlify.toml file is used to configure any custom headers. I have the following inside of the netlify.toml file

[build]
base = "crypto-movez/"
publish = "crypto-movez/build/"
command = "npm run-script build"


[[headers]]
    for = "/.well-known/stellar.toml"
    [headers.values]
        Content-Type = "text/plain"
        Access-Control-Allow-Origin = "*"

after conversating with some devs on the KeyBase app, it was suggested that I bring the question here to be able to receive additional support.

enter image description here

above is a picture of the file structure. When navigating to the website domain and going to the '/.well-known/stellar.toml', the file is then downloaded.

enter image description here

above is a picture of the curl response I am getting. I know that the content-type needs be returning as text/plain, and even though i am setting the headers in the netlify.toml file to allow for that type of content, this is what is coming back.

Any help is greatly appreciated. I have looked through as many other explanations possible so if you could please answer specifically that would be AWESOME

1
  • interesting updated.... when running a curl directly to the domain (without use of https://) i am now getting the following response ``` Cache-Control: public, max-age=0, must-revalidate Content-Length: 0 Content-Type: text/plain Date: Thu, 21 Nov 2019 21:53:55 GMT Location: cryptomovez.com/.well-known/stellar.toml Age: 0 Connection: keep-alive Server: Netlify X-NF-Request-ID: 8e94d9e6-72ce-474c-bab6-2716ea9ac07f-159018201 ``` if i try to visit the webpage though in browser it still is attempting to download the file
    – Jay Maas
    Commented Nov 21, 2019 at 21:56

1 Answer 1

3

Instead of using the netlify.toml directly, try creating an _headers file in the root directory. Then add:

# the stellar.toml file route
 /.well-known/stellar.toml  
  Access-Control-Allow-Origin: *
  Content-Type: text/plain
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.