I am using the cors module from npm and set CORS to be enabled for any traffic. My code snippet looks something like this.
const express = require('express');
const cors = require('cors');
const app = express();
// express app to use cors
app.use(cors())
When I used an external client (Vue) to access my login API from my Node.JS server, I got an error saying
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.
If I'm not wrong, instantiating cors without any options would permit all request regardless of origin. What went wrong here?