Cors : so simple

const cors = require('cors');

app.use(cors({ origin: /http:\/\/(127(\.\d){3}|localhost)/})); 

app.options('*', cors());


On remarque la regExp :  http:\/\/(127(\.\d){3}|localhost)

Soit  http:\/\/(127(\.\d){3} cad http://127.nb.nb.nb 

ou localhost