title: Angular 6 - To deploy App in production
body: <p>I am trying to upload my first Angular App to production, I have executed the command:</p>
  
  <pre><code>ng build --prod --build-optimizer
  </code></pre>
  
  <p>Next I copied the contents of the dist folder in the root directory of the server folder.</p>
  
  <p>I am seeing the application correctly, the only problem is when I reload the page in the browser, it gives me the following error:</p>
  
  <pre><code>Not Found
  The requested document was not found on this server.
  </code></pre>
  
  <p>In the index.html file I have the base tag in this way:</p>
  
  <pre><code>&lt;base href = "/"&gt;
  </code></pre>
  
  <p>And this is my routes file:</p>
  
  <pre><code>const routes: Routes = [
    { path: '', redirectTo: '/home', pathMatch: 'full' },
    { path: 'home', component: HomeComponent },
    { path: 'writer', component: WriterComponent },
    { path: 'music', component: MusicComponent },
    { path: '404', component: NotFoundComponent},
    { path: '**', redirectTo: '/404'}
  ];
  </code></pre>
  
  <p>What could be the problem?</p>