-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin to serve a file in a directory #4144
Comments
Hey @kevinhughes27 👋 did you see the docs on adding static files? If I understand what you're trying to do, then you should be able to put your file in a |
derp - I tried that first actually * but * that was before I found the docs on gh-pages --dotfiles. Let me give this a go. |
@m-allanson unfortunately this fails with the same error but still works locally. Any other ideas? |
Hmm... So after running Does |
Yup when I build locally it shows up in /public. I push public directly to the gh-pages branch so the .well-known folder is at the root level. |
I'm assuming its because of the directory or possibly the fact that its a hidden directory. I can look into it further on my own but I'd appreciate some help on where to start in the Gatsby code base |
If |
I've cleared the CDN a few times and tried turning it off. I get a 404 from Gatsby loader. What else should I try on the CDN? |
@kevinhughes27 Are you able to share a link to your site's GitHub repo? |
Oops sorry I should I have posted back. I ended up verifying my site using a DNS record instead. I don't want to make the repo public and it's pretty easy to reproduce if someone wants to look into it further. We can also close the issue. |
I had the same problem with GitHub pages. In local build and serve with Gatsby everythings works fine and |
Hello! I am working on a plugin for Brave payments verification with Gatsby. I need to serve a file at
/.well-known/brave-payments-verification.txt
.I followed the documentation on how to create a plugin and read some existing plugins. I wrote the following
gatsby-node.js
file based on the sitemap plugin:This worked and generated the appropriate file. I had to add the
--dotfiles
flag togh-pages
so this folder didn't get ignored during deploy.in
package.json
Finally I added a
gatsby-ssr.js
to let Gatsby know about the file:Everything works locally using
gatsby develop
and usinggatsby build
followed bygatsby serve
.However it does not work on production (fails with the error
A page wasn't found for "/.well-known/brave-payments-verification.txt"
from the loader). I'm deployed to Github pages with Cloudflare for ssl. I've deployed multiple times and cleared the CDN cache. I would expectgatsby serve
to produce the same result as the production environment.I'm lost on how else to debug this 😿 I'd love to get some help to get this working so I can contribute the plugin!
The text was updated successfully, but these errors were encountered: