DEV Community

JacobHsu
JacobHsu

Posted on

2

CORS

跨來源資源共用(CORS)
輕鬆理解 Ajax 與跨來源請求
這套規範跟你說,如果你想開啟跨來源 HTTP 請求的話,Server 必須在 Response 的 Header 裡面加上Access-Control-Allow-Origin

node Express cors

app.post("/api/request_disclosure", async (req, res) => {
    res.json(req.body);
});
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay