• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Consuming REST API exposed by Node.js in Backbone.js

 
Ranch Hand
Posts: 254
1
MySQL Database Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I'm consuming an API using Backbone.js by referring this book chapter: https://addyosmani.github.io/backbone-fundamentals/#exercise-2-book-library---your-first-restful-backbone.js-app I've written the server code in Node.js and made a DB connection to MongoDB. However, when I view the network panel I get an empty JSON. Unlike the book, I'm only implementing the GET action to obtain collection. Following is the code in its entirety. Can anyone point out where I'm going wrong?

I have a MongoDB collection called Inflation contained in inflation_database database. I then inserted a document in this collection with attributes `inflationDate` and `value`.

Collection view


Item View


app.js



model


collection


HTML


server.js
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!