How to set cross-domain settings for egg when the front and rear ends are separated

the front-end url is in the format of
http://localhost:3333/index.html-sharp/detail
accesses the backend and reports a cross-domain error
No "Access-Control-Allow-Origin" header is present on the requested resource.. Origin" http://localhost:3333" is therefore not allowed access.
how to configure the backend whitelist in
config.default.js:
http://localhost:3333/index.html-sharp/detail
is still invalid. If you can"t think of a sister, ask for advice!


instead of setting the whitelist, just specify the access domain name and enable the authentication mode in the origin configured by the egg cross-domain plug-in

//config.js
config.cors = {
    origin:'http://ip:port',
    credentials: true,
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
  };

Open cors

egg-cors Link description

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3801d-2c0f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3801d-2c0f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?