title: How do I configure http-server for history mode in Vue JS 2?
body: <p>I have a Vue JS application built in the directory <code>dist</code>. For running I use <code>http-server</code> installed globally by the command:</p>
  <pre><code>npm install -g http-server
  </code></pre>
  <p>I run the app with the command:</p>
  <pre><code>http-server dist
  </code></pre>
  <p>So I can reach the website on <code>http://localhost:8080</code>, it works correct. But in my app I have <code>vue-router</code> that is configured with history mode, so I should access the URLs like <code>http://localhost:8080/page1</code>, but the problem is <code>http-server</code> returns 404:</p>
  <pre><code>curl -i http://localhost:8080/page1
  
  HTTP/1.1 404 Not Found
  accept-ranges: bytes
  Date: Sat, 11 Sep 2021 12:41:53 GMT
  Connection: keep-alive
  Keep-Alive: timeout=5
  Content-Length: 0
  </code></pre>
  <p>How do I fix it?</p>