Answer the question
In order to leave comments, you need to log in
What is the modern approach to URL generation in SPA?
Now there is a site with routing: /about /news /etc all routing is virtual. when accessing /news directly, the user will receive a 404 error. there is no url on the server. What is the modern approach to process such a request correctly and return the desired page? Option only on the server to have it or something else?
Answer the question
In order to leave comments, you need to log in
vue has a vue-router that manages routing directly on the client, i.e. when a new path appears in the address bar, it matches the route and renders the corresponding component.
if the server is apache, nginx, iis and the like, then look towards settings like mod_rewrite, if the server is on node.js, then https://ru.vuejs.org/v2/guide/ssr.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question