Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OPTIONS http request method. #60

Open
maxfontana90 opened this issue Sep 20, 2018 · 3 comments
Open

Add support for OPTIONS http request method. #60

maxfontana90 opened this issue Sep 20, 2018 · 3 comments

Comments

@maxfontana90
Copy link

Currently, the api mock server its running on a different port when compared to the SPA Im trying to test with Protractor. Proxying API requests is not an option in my case.

Please add the ability to support OPTIONS http request methods so that preflight requests succeed.

@mdasberg
Copy link
Owner

mdasberg commented Oct 1, 2018

@maxfontana90 I will look into that

@SeJuDesign
Copy link

In case someone is curious.
The following mock file can be used as a catch all for all OPTION calls going to the API:
{ "name": "options", "request": { "url": "/api", "method": "OPTIONS" }, "responses": { "200": { "status": 200, "data": {}, "default": true } } }

@maxfontana90
Copy link
Author

Sorry to come in late, but I fixed this by adding the cors middleware to my express app that bootstraps ng-apimock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants