From 5adb72360945c3c346fc96aa40e943e7fbf48bdd Mon Sep 17 00:00:00 2001 From: Toil Date: Thu, 9 May 2024 02:08:53 +0300 Subject: [PATCH] fix cors --- bun.lockb | Bin 72778 -> 73154 bytes package.json | 1 + src/index.ts | 2 ++ 3 files changed, 3 insertions(+) diff --git a/bun.lockb b/bun.lockb index cfd34ab75fb8b68a0c86f2d6cd8b0373c493375b..e0e999f834a0e8833c6136705feb98279fd7f95b 100644 GIT binary patch delta 11443 zcmeHNc~}%zwy)dJN+GR45NH9x1qBrZ8f+Ay)o8RWQE_WM+xI~P`nP|-NIWLn$XOg_%sj5zRNnXBr-^_n+?)Uxb+}~Z# zIrr49s_uJozvr=oo~vV{7fyZm#{OoXK7Q=@)4WlBSFN)Z?}(up)&(EG_tn1S^>v35 z!i2=>?HWh8l6pkV>z5{y6z*f%`#bLN*A;;9b z-QNExPf3zN{*K1Jkd2Ksk6W787$wOB))QTVAe|+J1?35n6i4wQypq-7i2@+GuQw!5 zD0H4%Sm7+lmZUDI)`iCrEa~Jjmwg>6(HJdtfAG7{V(rqA%NjLYKoZH}k_f_rMse ze_`(QsjTiJz5a?WKZ0bxOw7$Ki79YOd(aOPxL$^Yt6Uz?g?Sz%kDCR_3%DNju*Be+ zMh^`^S$UvbT;Pn!D=eNMt!tq*AB}Rhwjgh6aT(k_R3DZbWfwZ7cS5vj`swW^6-=EN zGp$5g5~}r^P1znn(X+!emW)4TWxNS zNG)ngvdi;hplD8hcHtD%A4fU+F+bZG1AX(}0_Sm7wbRQJlwzIqxqm|`Oa~4dhklIIUmV67zn)mLYX>kvn+rNx{aGGlcBo@RqucIVk z0bKLJdC^PtamRO3`&YUSXc^Z|NDltKF`6qf(U7C58zc|tfD-JQfspLNE3uk91<7Wm zch(e2LOu6Ojgus-mPg7HdhxNS;eIvL% z^ko@n)%08p$$oG`;wCn@9@SPf8YH|1hpyN;V#J2r%_kZg_w{cwTW{i``HX0ji|q0n&?ASem42}M%omf zRO4sm2L7rd{x)MqW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s;MSVvw}AyU$YtStH+y_jJ19B zC*;%PpE))1s|_C-#C*06G4(Sy6RRqiV$Lg~4`rOsH(ZRT1?NYLjdU7CyXnv8m6*VB zpzPQY6J|d;O4S^ug~>pQ{i7MS-uK6+L^OS><@ug!8(+-i{@N#3?~b_fo4;9jv$xhy z3%uzx{e8u7vp+3=KbrmU+xPFxZAsD(7u6^0M`qRxC|J?=#oR0ykcKS|Q5QHJwB^{k z+6`0RcA*BVA~`ihs;7_^B_?oMNUq5F!=J`HxgYfz$!P;&yN?F9D29Cl=t4`h;q(9+ zbS2vG^#EGkGCEMG1$=aXX?1Bd;X*o$qYGvsQ^jS4E?wv<*3!2Z5L{g-L`4`waM%y>)Gg#LY< lzuoixL!%vXW@P5|NTrQ$M$?-gY-z0daAI&{#OJ&F{{tpI&{6;Z diff --git a/package.json b/package.json index 0301f21..d6dc2b9 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ }, "dependencies": { "@bogeychan/elysia-logger": "^0.0.21", + "@elysiajs/cors": "^1.0.2", "@elysiajs/swagger": "^1.0.4", "elysia": "^1.0.15", "pino-pretty": "^11.0.0" diff --git a/src/index.ts b/src/index.ts index d382b72..64e0afe 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,8 +9,10 @@ import setupElysia, { log } from "./setup"; import { InternalServerError, UnableAccessYandexAPI } from "./errors"; import detect from "./controllers/detect"; import getLangs from "./controllers/getLangs"; +import { cors } from "@elysiajs/cors"; const app = new Elysia() + .use(cors()) .use( swagger({ path: "/docs",