Coder Social home page Coder Social logo

Comments (3)

dmartinezg avatar dmartinezg commented on August 18, 2024

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.

igorkosta avatar igorkosta commented on August 18, 2024

Hi @dmartinezg,
thank you very much for such a detailed answer!

from api-designer.

igorkosta avatar igorkosta commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.