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
app.use(cors({ origin: /http:\/\/(127(\.\d){3}|localhost)/}));
On remarque la regExp : http:\/\/(127(\.\d){3}|localhost)
Soit http:\/\/(127(\.\d){3} cad http://127.nb.nb.nb
ou localhost
🪛Oublier __dirname
Les valeurs possibles :
{
weekday: 'narrow' | 'short' | 'long',
era: 'narrow' | 'short' | 'long',
year: 'numeric' | '2-digit',
month: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long',
day: 'numeric' | '2-digit',
hour: 'numeric' | '2-digit',
minute: 'numeric' | '2-digit',
second: 'numeric' | '2-digit',
timeZoneName: 'short' | 'long',
// Time zone to express it in
timeZone: 'Asia/Shanghai',
// Force 12-hour or 24-hour
hour12: true | false,
}