The URL is shown as
localhost:3000/index#/dashboard
but not
localhost:3000/index/#/dashboard
It's kind of wired.
Here is my express code.
app.get('/index', function (req, res) {
const html = fs.readFileSync('index.html', 'utf-8');
res.send(html);
});
And my vue-router code.
{
name: 'dashboard',
path: '/dashboard',
component: require('../views/dashboard.vue')
}
Try setting the mode: 'history' in your VueRouter
const router = new VueRouter({
mode: 'history',
routes: [...]
})
For more info also with express, refer to Vue Router HTML5 history mdoe