Comments (3)
Hi @igorkosta, you are pretty much describing CORS issues in your API.
In case you are not aware of what CORS is:
Due to security constraints, web browsers (and web services) do not allow web applications to reach a web services unless they are hosted in the same domain. To allow Cross Origin HTTP requests, web browsers make a special request (that OPTIONS request is called "preflight request") to the Web service, using some custom HTTP headers to find out if it is allowed to make the actual web service call, based on the server's response, the web browser then makes the actual HTTP request. This is all handled by the web browser automatically, so there's nothing we can do in the API-designer.
Solutions:
- host the API-designer in the same domain as the actual REST API you intend to call
- enable CORS in your REST API for the domain your API-designer is hosted (http://enable-cors.org/)
- host a service proxy in the same server you host the API-designer, this proxy would relay the API calls generated in the API-designer and relay them to your live REST service.
from api-designer.
Hi @dmartinezg,
thank you very much for such a detailed answer!
from api-designer.
Hi @dmartinezg,
do you know, how can we "teach" API-Designer to use the proxy hosted on the same server as the API-Designer itself. The only thing we can configure is the baseUri
in our .raml document.
Thank you for your help in advance!
from api-designer.
Related Issues (20)
- discriminatorValue not recognized if declared in sub-sub-type (warning) HOT 1
- How can I create a key named value? HOT 6
- Missed request module in dependencies. HOT 7
- Mock Service not accepting multiple occurrences of arrays HOT 1
- Syntax error in RAML 200 tutorial HOT 1
- !include no longer works as array item HOT 6
- API Manager in Anypoint RAML error HOT 4
- Array types not being displayed correctly HOT 1
- Error: /api.raml.meta does not exist HOT 2
- Error: Cannot find module 'request' HOT 15
- Unable to read external schemas in raml HOT 1
- NPM package is out of date HOT 7
- CLI arg --help
- Error when run api-designer HOT 5
- Mocking Service cannot be turned on... HOT 3
- Unable to check examples in README.md
- not able to see the vertical lines in editor
- support for git style versioning/source code control of RAML files
- Request entity too large when trying to save a modified RAML file in API Designer...
- Hosting on Apache displays console error "Cannot read property 'ds' of undefined"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-designer.