Commit 3317ec9 1 parent 36dd947 commit 3317ec9 Copy full SHA for 3317ec9
File tree 3 files changed +17
-1
lines changed
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const logger = require('morgan');
5
5
const path = require ( 'path' ) ;
6
6
const swaggerJsdoc = require ( 'swagger-jsdoc' ) ;
7
7
const swaggerUi = require ( 'swagger-ui-express' ) ;
8
+ const cors = require ( 'cors' ) ;
8
9
9
10
const apiRouter = require ( './routes/api' ) ;
10
11
const indexRouter = require ( './routes/index' ) ;
@@ -29,6 +30,7 @@ const openapiSpec = swaggerJsdoc({
29
30
30
31
app . use ( '/api-docs' , swaggerUi . serve , swaggerUi . setup ( openapiSpec ) ) ;
31
32
app . use ( logger ( 'dev' ) ) ;
33
+ app . use ( cors ( ) ) ;
32
34
app . use ( express . json ( ) ) ;
33
35
app . use ( express . urlencoded ( { extended : false } ) ) ;
34
36
app . use ( cookieParser ( ) ) ;
Original file line number Diff line number Diff line change 15
15
},
16
16
"dependencies" : {
17
17
"cookie-parser" : " ~1.4.4" ,
18
+ "cors" : " ^2.8.5" ,
18
19
"debug" : " ~2.6.9" ,
19
20
"ejs" : " ~2.6.1" ,
20
21
"express" : " ~4.16.1" ,
Original file line number Diff line number Diff line change @@ -454,6 +454,14 @@ cookie@0.7.2:
454
454
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7"
455
455
integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==
456
456
457
+ cors@^2.8.5 :
458
+ version "2.8.5"
459
+ resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
460
+ integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==
461
+ dependencies :
462
+ object-assign "^4"
463
+ vary "^1"
464
+
457
465
cross-spawn@^7.0.6 :
458
466
version "7.0.6"
459
467
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
@@ -1538,6 +1546,11 @@ normalize-path@^3.0.0, normalize-path@~3.0.0:
1538
1546
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
1539
1547
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
1540
1548
1549
+ object-assign@^4 :
1550
+ version "4.1.1"
1551
+ resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
1552
+ integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==
1553
+
1541
1554
object-inspect@^1.13.3 :
1542
1555
version "1.13.3"
1543
1556
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a"
@@ -2172,7 +2185,7 @@ validator@^13.7.0:
2172
2185
resolved "https://registry.yarnpkg.com/validator/-/validator-13.12.0.tgz#7d78e76ba85504da3fee4fd1922b385914d4b35f"
2173
2186
integrity sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==
2174
2187
2175
- vary@~1.1.2 :
2188
+ vary@^1, vary@ ~1.1.2 :
2176
2189
version "1.1.2"
2177
2190
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
2178
2191
integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==
You can’t perform that action at this time.
0 commit comments