title: Handle offline server in angular 5 service post request
body: <p>I'd like to handle it, when my node backend is gone. I'm using the MEAN-Stack and CORS-Middleware with <code>app.use(cors())</code>. </p>
  
  <p>So i tried to use <code>rxjs timeout</code> in my request -></p>
  
  <pre><code>return this.http.post('http://192.168.45.20:3000/bookings/', booking, {headers: headers})
      .timeout(3000)
      .map(res =&gt; res.json());
  }
  </code></pre>
  
  <p>When my server is online, everything works fine, but directly when the request was send and my server is offline i get an error </p>
  
  <blockquote>
    <p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading
    the remote resource at <a href="https://192.168.45.20:3000/bookings" rel="nofollow noreferrer">https://192.168.45.20:3000/bookings</a>. (Reason:
    CORS attack failed).</p>
  </blockquote>
  
  <p>So how do i handle the server offline state inside my angular 5 service?</p>