简体   繁体   中英

How to use both Vue-Router and Gorilla Mux Router

I started to create a web app using Vue JS as the front end framework. In this process, I'm using Vue-Router to route paths to my vue components. And I'm serving this web app using Go with gorilla mux as my router.

Here I am not able to load any component to <router-view></router-view> in App.vue .

I found a similar question here . And I tried removing mode: 'history' but no luck. In the comments, it was mentioned that he let Go redirect all not-found URLs to /# + r.URL.Path . I didn't understand this bit.

I'll appreciate if anyone can guide me with some example.

If possible, don't serve the front end from within the Go app. Here's what I do:

Go app is the backend, provides RESTful APIs for the front end to use.

There's a nginx server setup as a reverse proxy for the Go app.

nginx serves the front end directly

I use nginx to serve the Go backend in a certain url location or different port

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM