0

When I open a backbone app, which uses mysql, in Firefox, this is the url of the index.

file:///Users/mm/Sites/ccoenraets/web/index.html#

In the app itself, this is the url where it's supposed to retrieve the data from

 urlRoot:"../api/employees",

When I play around with the app in Firefox, it's not pulling data from the database. Do you know how I should change that urlRoot to make it get the data from the database. I tried the obvious without success

 urlRoot:"Users/mm/Sites/ccoenraets/web/index/api/employees",
lanzz
  • 42,060
  • 10
  • 89
  • 98
BrainLikeADullPencil
  • 11,313
  • 24
  • 78
  • 134
  • You haven't posted any code that is supposed to handle the `api/employees` URL, but in any case it will need to run on a webserver and not just have it loaded by your browser as a local file. – lanzz Sep 30 '12 at 21:59
  • ok, thanks. This is just a javascript app. I use webrick for Rails. do you know how I can get it running on a webserver if I'm not in the Rails environment? – BrainLikeADullPencil Sep 30 '12 at 22:01
  • Can't help you with Rails, but I've retagged your question, so now it should be more visible to Rails people. – lanzz Sep 30 '12 at 22:03
  • @ianzz sorry, miscommunication. It's NOT a Rails environment, so what webserver would you use? – BrainLikeADullPencil Sep 30 '12 at 22:07
  • I had to google WEBrick just to find out that it is actually a webserver implemented in Ruby. You _are_ going to do better if you're getting help with setting it up from Ruby/Rails people than from me. – lanzz Sep 30 '12 at 22:15
  • I got a webserver installed (static for Node js) and the app's running at localhost:8080. However, it's still not getting data from database. do i have to do anything special do you know? – BrainLikeADullPencil Sep 30 '12 at 23:26
  • You need to request your site through `http://localhost:8080` URLs, not through `file://...` URLs, _or_ use absolute URLs to `http://localhost:8080` in your HTML and Javascript. – lanzz Oct 01 '12 at 06:24

0 Answers0