jamessugrue / beginning-backbone

Code extracts from the upcoming Apress title, Beginning Backbone
34 stars 22 forks source link

Servercode using old packages #4

Closed daviddyrholm closed 9 years ago

daviddyrholm commented 10 years ago

Hi

I'm trying to run the servercode to test (and learn) Backbone, but I keep getting the following error:

XMLHttpRequest cannot load http://localhost:8080/books. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.

I've probably used hours trying to fix this by now and It's still not working. A couple of minutes ago I had a breakthrough though: The server code first gave some error about app.configure being deprecated, but I just changed it like on of the other posts in here said. Now I tried to copy the code again and look at the error. Suddenly I realised that I was running a version of Express where configure was removed and bodyparser.js / multipart.js was not includes. No wonder it wasn't working.

So my question is just which versions of the packages you are using for the server? Then I could just install those and get on reading/testing the code in your great book.

Hope to hear from you soon.

David

jamessugrue commented 10 years ago

If memory serves me correctly, the version of express I used was 3.3.4 Which version have you got now?

James

daviddyrholm commented 10 years ago

I used the latest, 4.4.5, but I have just installed 3.3.4 and now my server works :) I still get some deprecation errors in my terminal, but the code is running anyway.

Thank you very much for the quick answer!

David

jamessugrue commented 10 years ago

I will actually update all the code in this example and set up the scripts so that it installs specific versions.