File tree 2 files changed +17
-1
lines changed
packages/@pollyjs/node-server/src
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,22 @@ new Server({
83
83
});
84
84
```
85
85
86
+ ### corsOptions
87
+
88
+ _ Type_ : ` Object | Function `
89
+ _ Default_ : ` undefined `
90
+
91
+ Options passed to the ([ CORS] ( https://github.com/expressjs/cors ) ) middleware.
92
+
93
+ ``` js
94
+ new Server ({
95
+ corsOptions: {
96
+ origin: ' http://localhost:4000' ,
97
+ credentials: true
98
+ }
99
+ });
100
+ ```
101
+
86
102
## API Configuration
87
103
88
104
### recordingsDir
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export default class Server {
12
12
constructor ( config = { } ) {
13
13
this . config = { ...DefaultConfig , ...config } ;
14
14
this . app = express ( ) ;
15
- this . app . use ( cors ( ) ) ;
15
+ this . app . use ( cors ( this . config . corsOptions ) ) ;
16
16
17
17
if ( ! this . config . quiet ) {
18
18
this . app . use ( morgan ( 'dev' ) ) ;
You can’t perform that action at this time.
0 commit comments