title: How to implement angular server side rendering in laravel?
body: <p>I created a single page application with angular 5. I use this application with laravel backend. In the laravel project I have an angular folder, this folder store all the angular files. I built the angular application outside the angular folder, in a public folder in the root laravel's project folder. I set the web.php file, so if I go to homestead.test url the index.html will loaded from the public folder. After I set up the serverside rendering with <a href="https://github.com/angular/angular-cli/wiki/stories-universal-rendering" rel="nofollow noreferrer">stories universal rendering</a>, I built the client application and the server bundle. After I did this, and go to the homestead.test in the browser a I saw that my application doesn't look like before. With normal ng build (I'm hungarian by the way, so I used hungarian words):
  <a href="https://i.stack.imgur.com/g8SZf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g8SZf.png" alt="enter image description here"></a>
  After i did the universan rendering builds (<em>ng build --prod --extract-css</em>, <em>ng build --prod --extract-css --app 1 --output-hashing=false</em>, I used the --extract-css, because I used scss in the angular and when i didn't used it i got a lot of warnings):
  <a href="https://i.stack.imgur.com/iIyZX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iIyZX.png" alt="enter image description here"></a>
  And when I looked at the page source, it looked like the original angular source, but in the express server the source shows the real content.
  So my question is how to set up laravel to act like the express server? The <em>ng build --prod --extract-css</em> create a lot of js file, the assets folder and some other files, but the ng build only create some of them, without the assets folder. So how can I import all the assets folder and the js files in laravel? The stories universal rendering create a server.js file too from Node server.ts. I don't know this file is necessary in laravel.</p>
  
  <p>I also got some addicitonal questions:
  Is it the best way to connect laravel to an angular application? If yes, can I host it with real web host?
  Is there any free web host to test my application?
  If I succesfully display the angular app in laravel like I did with express server, than refresh the page in any url will works? Because now I got an error message.</p>
  
  <p>I created this application as a thesis app for my university and I've neved host app in the web, I only used local hosts.</p>