title: Nuxt generate static website using JSON sever
body: <p>I am trying to generate a static website using nuxt with Json server <a href="https://github.com/typicode/json-server" rel="nofollow noreferrer">Fake api server</a>. I am just trying to pre-poplulate the static site with data from the json server using npm run generate. Thanks for all help!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
  import axios from 'axios'
  export default {
    async asyncData() {
      const { data } = await axios.get('http://localhost:4000/gallery')
      return { gallery: data }
    }
  }
  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;template&gt;
    &lt;section class="gallery-grid"&gt;
      &lt;nuxt-link
        v-for="i in gallery"
        :key="i.id"
        :to="'/'+i.id"&gt;
        &lt;img
          :src="['gallery/'] + i.src + ['.jpg']"
          :alt="i.title"&gt;
      &lt;/nuxt-link&gt;
    &lt;/section&gt;
  &lt;/template&gt;</code></pre>
  </div>
  </div>
  </p>