Setting default route
-
Just starting out with Quasar and I’ve tweaked the basic app created by ‘quasar create …’ to play around with. When it starts up, the app is available at ‘http://localhost:8080/#/’. What would be causing this ‘#/’ at the end, and how can I get it instead to be simply ‘http://localhost:8080’?
-
@J2R You need to set history mode instead of hash mode: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
Note that it will require you to set up your webserver to handle it, as seen here: https://quasar.dev/quasar-cli/developing-spa/deploying#General-deployment
The above nginx config isn’t unique to Quasar, so you can find tons of examples with searches like “vue history mode nginx / apache” or “spa history mode nginx / apache”
-
@beets , thanks, that’s helpful. I can easily do that, and in fact I’ve done it already in a couple of Vue apps.
-
I’ve made the change so now have
vueRouterMode: 'history'
. But in dev mode it doesn’t make any difference, I’m still seeing the /#/. Does something else need to be configured in dev mode? -
@J2R Maybe just restart the dev server, but that shouldn’t be needed. Make sure you’re not just still seeing the
/#/
since the hot module reload won’t remove it. Try openinghttp://localhost:8080/
in a new tab and check there. -
Forget that, it was a simple error on my part. Works fine, thanks!