Pas de "Access-Control-Allow-Origin' avec Swagger et Foreman serveur Rails

J'ai mon serveur actuellement en cours d'exécution à 0.0.0.0:5100. Lorsque j'essaie d'accéder à mon Swagger docs, j'obtiens l'erreur suivante dans la console:

XMLHttpRequest cannot load http://0.0.0.0/api/v1/types.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:5100' is therefore not allowed access. 

Je me demande pourquoi est-ce qui se passe. Voici mon Swagger configuration dans index.html:

$(function () {
      window.swaggerUi = new SwaggerUi({
      url: "/api-docs.json",
      dom_id: "swagger-ui-container",
      supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
      onComplete: function(swaggerApi, swaggerUi){
        log("Loaded SwaggerUI");

        if(typeof initOAuth == "function") {
          /*
          initOAuth({
            clientId: "your-client-id",
            realm: "your-realms",
            appName: "your-app-name"
          });
          */
        }
        $('pre code').each(function(i, e) {
          hljs.highlightBlock(e)
        });
      },
      onFailure: function(data) {
        log("Unable to Load SwaggerUI");
      },
      docExpansion: "none"
    });

OriginalL'auteur Hommer Smith | 2014-05-08