P
P
Paka2021-11-10 12:41:28
Vue.js
Paka, 2021-11-10 12:41:28

How to skip request to server without vue-router processing?

I'm trying vue3.
There, by default, vue-router is enabled, which processes all requests in the address bar.

How can I set up some path, for example /api, so that vue-router does not process this path, but passes it to the server, where I could already process it with a server handler?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2021-11-10
@Aetae

If the question is about prod: configure the server so that it first returns /apifrom where it is needed, and only then wraps all requests for index.html.
If the question is about development: webpack dev servervue-cli is used , and there is a proxy through which you can send requests from to your production or local servers. /api

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question