O
O
ordinary_pavel2017-02-12 09:13:13
Node.js
ordinary_pavel, 2017-02-12 09:13:13

How to organize a SPA application on vue.js?

Hello. I'm doing a pen test on a spa application - a map with a search on it. Decided to use node.js + express, vue.js. How to organize application architecture? This is what came to my mind:
-> the user goes to "/?center=56.0416,92.9717&zoom=11" (url for example)
-> vue is doing routing, pulling out request parameters
-> an ajax post request flies to a restful backend like "/ api/items" with the parameters pulled by vue
-> the response is returned and vue renders the page.
Please point out errors and help with advice.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vadim Milevsky, 2017-02-12
@3gsxarakiri

For your purposes, you need to use vue-router, it allows you to dynamically pass parameters to the desired component, and that, in turn, will communicate with the node and do what you need.
Here is a documentary on Dynamic Routes

A
Alexander Manakov, 2017-02-12
@gogolor

Yes, it should)

B
BRONNER, 2017-02-14
@BRONNER

No POST requests are needed, they are intended for other purposes, for example, sending form data for processing. In your case, GET will be enough if you need to get some data, and not change it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question