Vue-cli creates a project, refreshes the page and reports a 404 error.

it is normal to start the server and enter 192.168.0.21purl 8080 in the browser, but when I jump to another routing page to refresh, the page reports a 404 error. I looked up a lot of information that said it was caused by html5"s history, but I didn"t know where to modify it. (after vue-router started history mode, the error of refreshing the page reported 404. Recently, I encountered a service that I could not solve. I used node"s plug-in http-server to run locally.)

guess it"s the reason here, but there"s no way to start

clipboard.png


you'd better paste the source code, otherwise you don't know what your problem is. Guess, did you execute npm run dev to appear, or did you execute npm run build to access the contents of the dist directory through http-server ?

Menu