node / common /access-control.ts
YYou3
add initial
5e9feb1
raw
history blame contribute delete
378 Bytes
export function policy(req:any, res:any, next:any) {
if (req.header('Origin')) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "*");
res.header("Access-Control-Allow-Headers", "Content-Type");
res.header("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, OPTIONS");
}
next();
}