var cors = require("cors");
cors({ origin: '*' });
cors({ allowHeaders: 'X-PINGOTHER'});
cors({ methods: 'GET,HEAD,PUT,PATCH,POST,DELETE'});
exports.endpoint = function(request, response) {
let text = '100,000';
response.writeHead(200, { 'Content-Type': 'text/plain' });
response.end(text);
}
我在 Runkit 上运行它,但在检查网站时仍然出现错误,我想在其中显示此返回值:“请求的资源上不存在‘Access-Control-Allow-Origin’标头”