📅  最后修改于: 2022-03-11 14:51:46.092000             🧑  作者: Mango
var express = require('express')var cors = require('cors')var app = express() app.use(cors()) app.get('/products/:id', function (req, res, next) { res.json({msg: 'This is CORS-enabled for all origins!'})}) app.listen(80, function () { console.log('CORS-enabled web server listening on port 80')})