From e5d3bb30f59565e974891e6af2f7684caee2d61c Mon Sep 17 00:00:00 2001 From: Messer4 Date: Fri, 19 Jul 2024 12:29:03 +0300 Subject: [PATCH] customise cors policy --- actions/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/actions/index.ts b/actions/index.ts index 78076bf..89a8a3f 100755 --- a/actions/index.ts +++ b/actions/index.ts @@ -9,7 +9,18 @@ import { z } from "zod"; var mime = require('mime-types') const app = new OpenAPIHono(); -app.use('/*', cors()); + +app.use( + '/*', + cors({ + origin: '*', + allowHeaders: ['Content-Type', 'Accept-Encoding', 'Authorization'], + allowMethods: ['POST', 'GET', 'OPTIONS'], + exposeHeaders: [], + maxAge: 600, + credentials: true, + }) +); // <--Actions--> app.route('/api/everstake/stake', everstake);