Here is simple vue-routing
const Foo = { template: '<div>foo</div>' } const Bar = { template: '<div>bar</div>' } const routes = [ { path: '/foo', component: Foo }, { path: '/bar', component: Bar } ]; const router = new VueRouter({ routes:routes, mode: 'history' }); var app = new Vue({ router, data: { message: 'Hello Vue!' }, mounted:function(){ } }).$mount('#app'); In HTML
<router-link to="/foo">Go to Foo</router-link> <router-link to="/bar">Go to Bar</router-link> <router-view></router-view> The links loaded properly (ie :/foo and /bar) when i click on it but if i refresh any vue routed url (ie /foo or /bar) url i will get error message
cannot get the page
I am serving it with simple express server
app.get('/', (req, res) => res.sendFile('index.html',{ root : __dirname}))
connect-history-api-fallbackfor the htm5 api fall back as shown and configure your express as shown here stackoverflow.com/questions/48277747/…index.htmllike:app.get('*'...