-
Notifications
You must be signed in to change notification settings - Fork 201
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
No provider for ORIGIN_URL #5
Comments
fix it 3d589fc |
@Gorniv thank, it has indeed. What pattern do you reckon about generating these pre-rendered pages? during development or production. Hardcoding URL suggest that we need to host the url because if pages use any http request to get data, pre-render fails since it cannot find any site on that url yet. When deployed on production, url will exist so pre-render can get the data. Also have you given any thoughts on caching strategy of dynamic or pre-renderd page? what are the options? |
Prerender build pages with all content one time. Value of |
@Gorniv in your case you aren't using ORIGIN_URL during SSR/Prerender but in my case I get some data fetched from server when application initialises, therefore in order to build these pre-rendered pages, I have to make a working ORIGIN_URL. And it works if I have ORIGIN_URL serving the data. Having site pre-rendered already for all urls surely boost performance since there isn't any server side execution. Does following code works for both pre-rendering and dynamic rendering?
Does it try to get pre-render page and then falls back to dynamic rendering? |
@asadsahi if you want to use prerender and dynamic rendering you need change server.ts. Server.ts need use a different route for prerendering and dynamic route. I will think about add example in the repository. |
@Gorniv If you don't generate prerender pages then existing setup does dynamic rendering. I am not using 100% your server.ts and prerender.ts but I think ngExpressEngine falls back to dynamic rendering if prerender pages aren't found. Your setup matches quite close to angular-universal starter and thats what I am following and just proved the concept described above. |
'node server.js' dont use prerender. Prerender is alternative for use static with seo and angular. |
Ahh I see, so does that mean with current setup it always use dynamic-rendering? pre-render pages are only if someone wants to use static pages? |
Thanks @Gorniv |
Just downloaded the project and run
npm run build:prerender
Getting this error:
I am using windows 10.
I am working in an another node-angular-ssr project and having exact error with url, in my case I have named it "BASE_URL", but it fails during prerender generation phase. Wondering if there is an environment related issue going on here.
The text was updated successfully, but these errors were encountered: