I've inserted the following lines into my code:
var express = require('express');
var cors = require('cors');
var app = express();
app.options('*', cors());
app.use(cors());
However, when I make an AJAX POST request, I still get the error:
POST https://stormy-plateau-94715.herokuapp.com/login
new-page-5:1 XMLHttpRequest cannot load https://stormy-plateau-94715.herokuapp.com/login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://squareguru.squarespace.com' is therefore not allowed access. The response had HTTP status code 503.
This is my first time using the cors package, am I configuring something wrong? I would love any help you guys can give me, thanks!