// Dom7
var $$ = Dom7;

// Framework7 App main instance
var app  = new Framework7({
  root: '#app', // App root element
  id: 'io.framework7.testapp', // App bundle ID
  name: 'Framework7', // App name
  theme: 'auto', // Automatic theme detection
  // App routes
  routes: routes,
});

// Init/Create main view
var mainView = app.views.create('.view-main', {
  url: '/'
});
 
//load up data from the API at runtime
app.request.json('http://localhost:3000/allboards', function(mydata){ 
  app.data.boards = mydata ; 
});

//load surfboard data from the API at runtime
app.request.json('http://localhost:3000/allsurfboards', function(mydata){ 
  app.data.surfboards = mydata ; 
});

//load snow data from the API at runtime
app.request.json('http://localhost:3000/allsnowboards', function(mydata){ 
  app.data.snowboards = mydata ; 
});

//load snow data from the API at runtime
app.request.json('http://localhost:3000/allreviews', function(mydata){ 
  app.data.reviews = mydata ; 
});  
 
 console.log(app.data);