1

I created an Angular 7 app and built it using Angular universal to make it SEO friendly. However, as I was reading, it is not possible to deploy it now on a shared server (once build with Angular universal, otherwise it is possible), since it requires Node.JS to run the script file on server.

My problem is that my hosting plan is on a shared server so I will not be able to run it using Node.JS but I still care of having my app SEO friendly.

What can be a good solution?

1 Answer 1

2

Angular Universal renders your application in server side before serving the page (SSR). Indeed you will need nodejs to make it work.

You need to prerender your application as static files.

With @ng-toolkit/universal installed you should be able to prerender your application with the command :

npm run build:prerender 

Now, you should see new folder dist/static , inside which all your application views should be prerendered and can be served as static files.

Sign up to request clarification or add additional context in comments.

1 Comment

@ng-toolkit/universal gives me error, so i used ng add @nguniversal/express-engine and after that i used npm run build:ssr && npm run serve:ssr ...now at this point please tell me how can i uplaod my dist folder to my hosting site so that it should not create problem on page refresh and on rounting to other page .. please notice my shared webhosting does not provide the support for node.js servere

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.