title: SOLVED Cannot get CORS to work no matter what I try
body: <p><strong>SOLVED</strong> thanks to Freakish in the comments the issue was my endpoint was using <code>localhost:3030</code> instead of <code>http://localhost:3030</code></p>
  
  <p>Node is running on port 3030 and ionic is running in serve on port 8100 so <code>localhost:3030</code> and <code>localhost:8100</code> I know this is the problem and have looked for all the ways to implement and allow CORS. </p>
  
  <p>I have tried everything under the sun from installing and using cors middleware to following other guides on implementing CORS. In the code below is where I tried following a guide to make a custom middleware and even that doesn't work. </p>
  
  <p>Side note socket.io is working just fine.</p>
  
  <pre><code>app.use(bodyParser.urlencoded({'extended':'true'}));
  app.use(bodyParser.json({ limit: '5mb' }));
  
  // enable CORS
  app.use(function( req, res, next ) {
      res.header("Access-Control-Allow-Origin", "*");
      res.header("Access-Control-Allow-Headers", "x-requested-with, content-type");
      res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS");
      res.header("Access-Control-Allow-Credentials", "true");
      res.header("Access-Control-Max-Age", "1000000000");
      if ('OPTIONS' == req.method) { res.send(200); } else { next(); } 
  });
  
  io.on('connection', (socket) =&gt; {
      socketIo.process(socket, io);
  });
  
  app.post('*', (req, res) =&gt; { 
      post.process(req, res);
  });
  
  http.listen(port, function(){
      console.log('Listening on Port: ' + port);
  });
  
  </code></pre>
  
  <p>Besic error I get when trying to post. </p>
  
  <pre><code>Access to XMLHttpRequest at 'localhost:3030/api/signin' from origin 'http://localhost:8100' has been blocked by CORS policy: 
  Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
  </code></pre>