-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix(fastify) New files requires a server restart to be served #523
base: master
Are you sure you want to change the base?
Conversation
@tristan957 could you take a look at this? We had successfully battle-tested it. For now, it's huge blocker for development with webpack for example. |
I am not a maintainer, nor am I at all familiar with fastify. Maybe you're meaning to tag someone else |
Ooops yeah, my bad Meant to tag @kamilmysliwiec |
Hi, I've stumbled across the same problem. Any chance of this getting merged? Or at least giving us control over the |
+1
|
Hi, I got the issue with new files are not being served. But there are no way to access wildcard in fastify. So how to serve new files then?
|
+1 |
Is there a chance we can merge this? I really need it. Thank you @SnakeDrak for the work! cc @kamilmysliwiec |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
New files are not served using fastify. On this issue or in the documentation of
fastify-static
is commented that using thewildcard
option tofalse
will create only routes to the current files in the system and it will not serve new files.The issue was introduced on this PR due to the fail of the redirection to the index.
Steps to reproduce it
FastifyAdapter
and start the server.test.txt
under the static folderclient
./test.txt
.It will redirect to the index.html and the test file will not be served.
What is the new behavior?
The solution is to remove the
wildcard
option tofalse
by default. However, it would create404
error when the file doesn't exist and it would not redirect to the index. To solve this latest situation, I have caught the 404 error when they are generated under therenderPath
with thefastify
adapter to serve the index file, supporting the current behaviour.Does this PR introduce a breaking change?
Other information