From b71643839c5958d1708f025a8faf1e73105a56a2 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 21 May 2023 20:07:25 -0700 Subject: [PATCH] Close #10175 --- packages/backend/src/server/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index 8035dcdd7..95d570eb3 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -7,6 +7,7 @@ import * as fs from "node:fs"; import * as http from "node:http"; import Koa from "koa"; import Router from "@koa/router"; +import cors from "@koa/cors"; import mount from "koa-mount"; import koaLogger from "koa-logger"; import * as slow from "koa-slow"; @@ -41,6 +42,12 @@ app.proxy = true; app.use(removeTrailingSlash()); +app.use( + cors({ + origin: "*", + }), +); + if (!["production", "test"].includes(process.env.NODE_ENV || "")) { // Logger app.use(