title: How to read the JSON file from the API in the interface
body: <p>I want to read a JSON file  from the API every 11 seconds and display it in the interface<br />
  In my case :
  the interface server is running at http://localhost:8080/
  the API at http://localhost:8088/route (and I need to refresh it every 11 seconds because parameters changes)</p>
  <p>and in route.js :</p>
  <pre><code>var i=0;
  var delayInms = 11000; 
  
  var myVar = setInterval(TempFunction, 1000);
  function TempFunction() {
  
  router.get('/', (req,res,next)=&gt;{
      var text =[
          {&quot;carspeed&quot;:[233+i,445+i,223+i,444+i,234+i]},
         
      ]
         console.log(text);
         res.status(200).json(text);
          });
          window.location.reload(true);
           i++;
  
      }
  </code></pre>
  <p>********THE PROBLEM is that I get this error:</p>
  <blockquote>
  <p>ReferenceError: window is not defined</p>
  </blockquote>
  <p>I have another question :
  to read the JSON (which is updated in http://localhost:8088/route every 11 seconds) I did this :
  in car.vue :</p>
  <pre><code>&lt;template&gt;
  .
  .
  &lt;ul&gt;
  &lt;li v-for=&quot;todo of todos&quot; :key=&quot;todo.id&quot;&gt;{{todo.text}}&lt;/li&gt;
  &lt;/ul&gt;
  .
  .
  &lt;/template&gt;
  </code></pre>
  <p>followed by :</p>
  <pre><code>&lt;script&gt;
  import axios from 'axios';
  const WorkersURL=&quot;http://localhost:8088/route&quot;;
  
  export default {
    data: () =&gt; ({
    drawer: false,
    todos:[]
  
  }),
  async created()
  {
    try
   {
    const res = await axios.get(WorkersURL);
    this.todos=res.data;
   }
  catch(e)
  {
   console.error(e)
  }
  
    }
  }
  &lt;script&gt;
  </code></pre>
  <p>********AND THE SECOND PROBLEM : it doesn't read the JSON file from http://localhost:8088/route</p>