erunion / showtimes

[deprecated] a movie showtimes API
MIT License
52 stars 14 forks source link

405 / Access-Control-Allow-Origin #26

Closed mistermendez closed 8 years ago

mistermendez commented 9 years ago

Request to Google Movies returns -

Failed to load resource: the server responded with a status of 405 (Method Not Allowed)

XMLHttpRequest cannot load http://google.com/movies?hl=en&near=20001&date=0&start=0. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4444' is therefore not allowed access. The response had HTTP status code 405.

erunion commented 9 years ago

How are you using Showtimes? Through Browserify, or running on a server?

labago commented 8 years ago

I also get this error, using a local server from browserify

erunion commented 8 years ago

@labago I don't have any experience running Browserify, you mind sharing the code you have with instructions on how to run it?

labago commented 8 years ago

I honestly can't describe that to you since i don't know much about it myself haha, I didn't set the project up. What I can tell you is that I successfully installed this module to the project, I require it just like any other module, it gets bundled into a batch js file with all the other modules and scripts on this local app. Then, when loaded in the browser and running the example code provided here https://www.npmjs.com/package/showtimes I get the 405 error.

erunion commented 8 years ago

Looking into this, it doesn't seem like Showtimes can be used within a Browserify environment because Google Movies doesn't allow cross-origin requests. If you do want to use it, you'll have to run Showtimes on a server, and have your frontend code call that.