T
T
tempick2020-06-02 20:09:09
PHP
tempick, 2020-06-02 20:09:09

How to develop on vue cli + backend on another server?

There is Openserver, where a ready-made backend is written in PHP (Yii2), and there is a project on vue-cli. How to "combine" them? Now it turns out that two local servers are running. Is it possible to somehow combine the frontend and backend on the same local server?
UPD: the second server is created when I write "npm run serve" to work with vue

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
Timur Khudiyev, 2020-06-03
@tempick

Look here . The truth is in English, but you can understand. It shows how to deal with CORS

A
Aetae, 2020-06-02
@Aetae

The one that starts when it is serveadapted for development: there is a hot reload and everything else.
You can cheat build --watchand use your prod server right away, but it's slow and inconvenient.

A
Andrew, 2020-06-02
@AndrewRusinas

Xs, I've been developing this way all my life, what's the problem? In one terminal, the front spins, in the other, the back on the node. Convenient - for example, separate output to console (errors, for example). And fast.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question