D
D
dfhkjhg2020-08-11 14:50:41
Express.js
dfhkjhg, 2020-08-11 14:50:41

How to run front and back on the same address?

When I run backend on localhost:5000 and fron on vue on localhost:8080 then everything works. But how to make the front and back be on localhost:8080?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aetae, 2020-08-11
@dfhkjhg

If you need it for development, then you don't need it.)
Use webpack devserver (out of the box in vue-cli ) and configure the proxy before the backend. For the front, everything will be "on one server" and no troubles are needed.

I
Ivan Shumov, 2020-08-11
@inoise

Put nginx in front of them and separate them into different routes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question