Skip to content

CORS是一个node.js软件包,用于提供可用于通过各种选项启用CORS的Connect / Express中间件

js
import { filesize } from "filesize";
js
var cors = require("cors");
app.use(
  cors({
    origin: ["http://localhost:8000"],
    methods: ["GET", "POST"],
    alloweHeaders: ["Conten-Type", "Authorization"],
  })
);