Skip to content
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

Setup Nest for Angular routing #80

Closed
dchrzanowski opened this issue May 20, 2018 · 3 comments
Closed

Setup Nest for Angular routing #80

dchrzanowski opened this issue May 20, 2018 · 3 comments

Comments

@dchrzanowski
Copy link

Referring to an issue that I have incorrectly placed in the framework repo.

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ ] Feature request
[X] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

It is unclear which behaviour to use for serving an Angular app with routing. Should I use a * path controller as the last on in the array of controllers and do a res.sendFile to serve the index.html file or should I use a HttpExceptionFilter to res.sendFile the index.html file whenever the path is unresolved?

What is the motivation / use case for changing the behavior?

Using the HttpExceptionFilter filter seems like a logical choice, because of Angular needing access to other static files. This should be clearly laid out in the documentation in my opinion.

Basically: Have a distinct pattern to serve an Angular application, since this framework is very friendly with Angular.

Environment

NestJS 5.0.0

@pumano
Copy link
Contributor

pumano commented May 24, 2018

I agree with it, I have working example for it and can help with documentation. @kamilmysliwiec how do you think about it?

@kamilmysliwiec
Copy link
Member

kamilmysliwiec commented Jun 24, 2018

PR's are open @pumano 🙂Feel free to do it!

@kamilmysliwiec
Copy link
Member

Recipe: https://docs.nestjs.com/recipes/serve-static
And for SSR: https://github.com/nestjs/ng-universal (ng add @nestjs/ng-universal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants