Skip to content

Commit c896cf9

Browse files
authored
Merge pull request #11 from viv3kk/master
Handle CORS issue for chrome
2 parents 39c667c + 157bdd8 commit c896cf9

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ if (program.verbose) {
7373
});
7474
}
7575

76-
app.use(cors());
76+
var corsOptions = {
77+
origin: true,
78+
credentials: true,
79+
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
80+
preflightContinue: false,
81+
optionsSuccessStatus: 204
82+
};
83+
84+
app.use(cors(corsOptions));
7785

7886
for (var path in config.map) {
7987
(function (basePath) {

0 commit comments

Comments
 (0)