📅  最后修改于: 2022-03-11 15:01:52.080000             🧑  作者: Mango
// Enable CORS on 11ty > headers: {"Access-Control-Allow-Origin": "*"}
// Edit: eleventy.js:
module.exports = function(eleventyConfig) {
eleventyConfig.setBrowserSyncConfig({
middleware: function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}
});
};
// References: https://medium.com/@matthewcrist/how-to-enable-cors-in-browsersync-6389e911764b