File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 39
39
"@aws-sdk/util-dynamodb" : " ^3.624.0" ,
40
40
"@fastify/auth" : " ^4.6.1" ,
41
41
"@fastify/aws-lambda" : " ^4.1.0" ,
42
+ "@fastify/cors" : " ^9.0.1" ,
42
43
"fastify" : " ^4.28.1" ,
43
44
"fastify-plugin" : " ^4.5.1" ,
44
45
"jsonwebtoken" : " ^9.0.2" ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import errorHandlerPlugin from "./plugins/errorHandler.js";
8
8
import { RunEnvironment , runEnvironments } from "./roles.js" ;
9
9
import { InternalServerError } from "./errors/index.js" ;
10
10
import eventsPlugin from "./routes/events.js" ;
11
+ import cors from '@fastify/cors'
11
12
12
13
const now = ( ) => Date . now ( ) ;
13
14
@@ -62,6 +63,10 @@ async function init() {
62
63
} ,
63
64
{ prefix : "/api/v1" } ,
64
65
) ;
66
+ await app . register ( cors , {
67
+ origin : ( process . env . ValidCorsOrigins || "*" ) . split ( ',' )
68
+ } )
69
+
65
70
return app ;
66
71
}
67
72
Original file line number Diff line number Diff line change 882
882
resolved "https://registry.yarnpkg.com/@fastify/aws-lambda/-/aws-lambda-4.1.0.tgz#67dc617bbd596e078bee6e83a4ec9d31dee7686b"
883
883
integrity sha512-293HSdtr4muZZi4UxjrDgddxlLRDbNxT5x/eOX78obMA1Du3tfpuP7WuyfnA4GXaeckj/soJ2jiuD2sM4VIW9Q==
884
884
885
+ " @fastify/cors@^9.0.1 " :
886
+ version "9.0.1"
887
+ resolved "https://registry.yarnpkg.com/@fastify/cors/-/cors-9.0.1.tgz#9ddb61b4a61e02749c5c54ca29f1c646794145be"
888
+ integrity sha512-YY9Ho3ovI+QHIL2hW+9X4XqQjXLjJqsU+sMV/xFsxZkE8p3GNnYVFpoOxF7SsP5ZL76gwvbo3V9L+FIekBGU4Q==
889
+ dependencies :
890
+ fastify-plugin "^4.0.0"
891
+ mnemonist "0.39.6"
892
+
885
893
" @fastify/error@^3.3.0" , "@fastify/error@^3.4.0":
886
894
version "3.4.1"
887
895
resolved "https://registry.yarnpkg.com/@fastify/error/-/error-3.4.1.tgz#b14bb4cac3dd4ec614becbc643d1511331a6425c"
3462
3470
dependencies :
3463
3471
obliterator "^1.6.1"
3464
3472
3473
+
3474
+ version "0.39.6"
3475
+ resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.39.6.tgz#0b3c9b7381d9edf6ce1957e74b25a8ad25732f57"
3476
+ integrity sha512-A/0v5Z59y63US00cRSLiloEIw3t5G+MiKz4BhX21FI+YBJXBOGW0ohFxTxO08dsOYlzxo87T7vGfZKYp2bcAWA==
3477
+ dependencies :
3478
+ obliterator "^2.0.1"
3479
+
3465
3480
3466
3481
version "2.1.2"
3467
3482
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
@@ -3547,6 +3562,11 @@ obliterator@^1.6.1:
3547
3562
resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-1.6.1.tgz#dea03e8ab821f6c4d96a299e17aef6a3af994ef3"
3548
3563
integrity sha512-9WXswnqINnnhOG/5SLimUlzuU1hFJUc8zkwyD59Sd+dPOMf05PmnYG/d6Q7HZ+KmgkZJa1PxRso6QdM3sTNHig==
3549
3564
3565
+ obliterator@^2.0.1 :
3566
+ version "2.0.4"
3567
+ resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816"
3568
+ integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==
3569
+
3550
3570
on-exit-leak-free@^2.1.0 :
3551
3571
version "2.1.2"
3552
3572
resolved "https://registry.yarnpkg.com/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz#fed195c9ebddb7d9e4c3842f93f281ac8dadd3b8"
You can’t perform that action at this time.
0 commit comments