// In the entry file often index.js or app.js
const express = require('express')
const app = express()
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', '*') // The second parámeter could be a list of domains
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization')
next()
})