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
Question: How to bypass /static path to next.js? #48
Comments
Ok, after read render.filter.ts i understand what any request not handled by nest controllers go to next. So i order to provide static file you need to create directory static in next project root.
|
This was recently brought up in #47. One of the main problems is how Nextjs handles the public files. Let's say that you have a fresh nextjs install without any nest integrations and you have your logo saved to So this brings up the question of how do we know what requests are for a static files since we can't just check if the req starts with |
@Xilel I just added a new config option, see this comment for some info on how to get the public directory working |
why dont you just add a static serving module in NestJS lol |
@stevefan1999-personal That should work fine as long as you want to have Nest serve the static content rather than Next. Next allows for serving static content from the |
@kyle-mccarthy well but it sort of works. Hell, I was even able to get |
Let's say, you want to get some static files to be load on pages (like img) with next.js (https://nextjs.org/docs/basic-features/static-file-serving). Right now all links to /static path will be captured with nest.js. You can use @nestjs/serve-static but it is unpleasant to use. Is were are some way to pass this matter to nest-next?
Nest-next version: 9.1.5
Next version: 9.3.3
Nest: 7.0.9
The text was updated successfully, but these errors were encountered: