Hello,
I have installed framework7 for the first time and would like to know if someone could tell me why when I try to pass the url:
http://192.168.0.4:3000/home/
I get this error on the page:
Cannot GET /home/
Here is my my-app.js code:
// Initialize app
var myApp = new Framework7({
routes: [
{
name: 'home',
path: '/home/',
url: 'home.html'
},
{
name: 'login',
path: '/login/',
url: 'login.html'
},
{
name: 'register',
path: '/register/',
url: 'register.html'
},
{
name: 'sendreport',
path: '/sendreport/',
url: 'sendreport.html'
},
{
name: 'contact',
path: '/contact/',
url: 'contact.html'
},
{
path: '(*)',
url: '404.html'
}
]});
// If we need to use custom DOM library, let's save it to $$ variable:
var $$ = Dom7;
// Add view
var mainView = myApp.addView('.view-main', {
// Because we want to use dynamic navbar, we need to enable it for this view:
dynamicNavbar: true
});
// Handle Cordova Device Ready Event
$$(document).on('deviceready', function () {
console.log("Device is ready!");
});
// Option 2. Using one 'pageInit' event handler for all pages:
$$(document).on('pageInit', function (e) {
// Get page data from event data
var page = e.detail.page;
if (page.name === 'home') {
// Following code will be executed for page with data-page attribute equal to "about"
myApp.alert('Here comes the home page');
}
if (page.name === 'login') {
// Following code will be executed for page with data-page attribute equal to "about"
myApp.alert('Here comes the login page');
}
if (page.name === 'register') {
// Following code will be executed for page with data-page attribute equal to "about"
myApp.alert('Here comes the register page');
}
if (page.name === 'contact') {
// Following code will be executed for page with data-page attribute equal to "about"
myApp.alert('Here comes the contact page');
}
if (page.name === 'sendreport') {
// Following code will be executed for page with data-page attribute equal to "about"
myApp.alert('Here comes the sendreport page');
}
});
// Option 2. Using live 'pageInit' event handlers for each page
// $$(document).on('pageInit', '.page[data-page="home"]', function (e) {
// myApp.alert('Here comes About page');
// });
Thank you