Closed df-jsykes closed 10 years ago
This still leaves a default callback wrapper object.
Here is my index.html
<!DOCTYPE html>
<html>
<script src='lib/shred.bundle.js' type='text/javascript'></script>
<script src='lib/swagger.js' type='text/javascript'></script>
<script type="text/javascript">
// initialize swagger, point to a resource listing
window.onload=function () {
window.df = new SwaggerApi({
url:"https://next.cloud.dreamfactory.com/rest/api_docs",
supportedSubmitMethods: ['get', 'post', 'put', 'patch', 'merge', 'delete']
});
window.authorizations.add("X-DreamFactory-Application-Name", new ApiKeyAuthorization("X-DreamFactory-Application-Name", "todoangular", "header"));
window.authorizations.add('Content-Type', new ApiKeyAuthorization('Content-Type', 'application/json', 'header'));
window.df.authorizations = window.authorizations;
window.df.build();
};
</script>
<head>
<title></title>
</head>
<body>
<div id="mydata"></div>
</body>
</html>
in your console, you can try df.apis.system.getConfig(); to see the wrapper
I'm running this from the file system. Something wrong with my Swagger API itself?
I do see an issue with our CORS set up, will update this, or hit you up on #swagger once I verify this is fixed.
I put up a short page on handling CORS issues, you might look here for some other tips:
Turns out its not a cors issue, running everything locally, still seeing a "default callback:" wrapper, investigating. Thanks man.
Its working on localhost, I wont know anything about the CORS issue til next week, but the file system / localhost stuff is working now, only it still logs the data in the console with "default wrapper", that's going to confuse some people possibly. Thanks for your help
you'll only see that message if there is no other callback set in the library. reopen if you still have trouble
Currently when i make a cross domain call, it does so and returns the data in a callback. The server I'm hitting uses CORS, so the wrapper isn't needed. What can I do to let my server decide how to handle cross domain, not swagger-js, or am I missing something?