B
B
bpGusar2019-10-21 14:35:54
Node.js
bpGusar, 2019-10-21 14:35:54

How to configure routing so that all statics would open through localhost:3000?

the front is launched on port 3000, the back is on port 5000.
When adding a link to an image to the database, I add it like this
localhost:5000/posters/book_poster_1571656776796.png
but I understand that this is stupid and not right
, so here's how to do it in such a way that it would be indicated in the database just /posters/book_poster_1571656776796.png and what would be used if you specify on the front of the link like

<img src="/posters/book_poster_1571656776796.png" />
Did it open correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bpGusar, 2019-10-21
@bpGusar

specified in package.json "proxy": "http://localhost:5000",and now everything works as it should

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question