Add a slug in URL

I'm hosting a Vue SPA in IIS.

I'm using VueRouter, and in my routes I have:

const routes = [
    { path: '/', name: 'Home', component: Home },
    { path: '/customers', name:'customers', component: Customers },
    { path: '/qadcustomers', name:'qadcustomers', component: QadCustomers },
    { path: '/customer/:id?', name:'customer', component: Customer, props: true },
    { path: '/qadcustomer/:id?', name:'qadcustomer', component: QadCustomer, props: true },
    { path: '/import', name:'import', component: Import },

In the web server, I'm putting the files inside the directory: inetpub/wwwroot/dev/myapplication

What I would like to happen is that the application is accessed at:

https://myserver/dev/myapplication/ <-- This will go to Home

https://myserver/dev/myapplication/customers <-- This will go to Customers

https://myserver/dev/myapplication/qadcustomers <-- This will go to QadCustomers

What happens now is that all my page is at https://myserver/customers, or https://myserver/qadcustomers. How do I add the slug /dev/myapplication/ to the URL?

Read more here:

Content Attribution

This content was originally published by Farid at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: