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

Automatically add OPTIONS action #59

Merged
merged 10 commits into from
Jul 2, 2015
Merged

Conversation

MartinNuc
Copy link
Contributor

When creating server based on API blueprint I wanted to use AngularJS against drakov as a basic mocking server.

First I allowed CORS headers (including HEADERS for POST requests):

res.set('Access-Control-Allow-Origin', '*');
res.set('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');

After I would have to add OPTIONS action for every route so CORS prefight is successful.

Therefore I made slight changes to drakov to add OPTIONS action where it's missing. This is being turned on using flag --autoOptions

@yakovkhalinsky
Copy link
Contributor

Awesome thanks for the PR 👍

I'll have a look and make comments

@@ -69,6 +69,12 @@ By default a CORS header is sent, you can disable it with the --disableCORS swit

`drakov -f "../com/foo/contracts/*.md" --disableCORS`

## Automatic response to OPTIONS requests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge thank you for updating the README 👍 🎱

@yakovkhalinsky
Copy link
Contributor

Nice work 👍

A very well documented and tested PR 🎱

@yakovkhalinsky
Copy link
Contributor

Bringing this again to the top, will review this again for possible release in 0.1.8

@yakovkhalinsky yakovkhalinsky added this to the 0.1.8 release milestone Jul 2, 2015
@yakovkhalinsky
Copy link
Contributor

Merging

yakovkhalinsky added a commit that referenced this pull request Jul 2, 2015
Automatically add OPTIONS action
@yakovkhalinsky yakovkhalinsky merged commit 4da9479 into Aconex:master Jul 2, 2015
@MartinNuc
Copy link
Contributor Author

Dont have time for that refactoring I promissed in #59 (comment) :-(

@yakovkhalinsky
Copy link
Contributor

@MartinNuc don't worry too much about it :)

It's great to get this feature out to the people using Drakov.

At this stage I'm ok with the code structure, which can evolve in the future 🎱

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

Successfully merging this pull request may close these issues.

2 participants