From 274f9de6da9e30c5f6382fe15181b4e406d5adca Mon Sep 17 00:00:00 2001 From: Carlos S Aldazosa Date: Tue, 21 May 2024 16:46:03 -0400 Subject: [PATCH] [FIX] backend cors and fonticons service ci/cd --- .github/workflows/ci-service-fonticons.yml | 4 ++-- packages/backend/src/index.ts | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-service-fonticons.yml b/.github/workflows/ci-service-fonticons.yml index 3b0c185..54dff84 100644 --- a/.github/workflows/ci-service-fonticons.yml +++ b/.github/workflows/ci-service-fonticons.yml @@ -18,11 +18,11 @@ jobs: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.1 with: - workflow_id: "ci-service-fonticons.yml" + workflow_id: 99079597 access_token: ${{ github.token }} Deploy: - runs-on: ubuntu-lates + runs-on: ubuntu-latest name: Deploy steps: - uses: actions/checkout@v4 diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index dfbd71c..971477b 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -8,10 +8,12 @@ import { cors } from "hono/cors"; const app = new Hono().basePath("api/v1"); -app.use("/*", cors()); +app.use("/*", async (c, next) => { + const handler = cors({ + origin: [c.env?.CLIENT_URI as string, "http://localhost:3001"], + }); -app.get("/", (c) => { - return c.text("it works"); + return await handler(c, next); }); app.route("/auth", auth);