Browse Source

update revisi cors

pearlgw 3 weeks ago
parent
commit
f3013800ef
1 changed files with 5 additions and 1 deletions
  1. 5 1
      index.ts

+ 5 - 1
index.ts

@@ -39,7 +39,11 @@ const corsOptions = {
39 39
 };
40 40
 
41 41
 // app.use(cors());
42
-app.use(cors(corsOptions));
42
+app.use(cors({
43
+    origin: "*",
44
+    methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
45
+    allowedHeaders: ["Content-Type", "Authorization"]
46
+}));
43 47
 app.options(/(.*)/, cors(corsOptions));
44 48
 app.use(bodyParser.json());
45 49
 app.use(keycloak.middleware());