R
R
r1mple2020-11-07 19:52:31
Python
r1mple, 2020-11-07 19:52:31

How to connect back and front on the same domain?

I am, so to speak, new in all this, I am writing something like the weather on aiohttp and react, the api is already there, there is no front yet, but still.
I run Python from the console, say on port 8080, so the react is launched from the console, only on a different port, and I need them to run on the same port so that the react page is rendered, but also for ayohttp to work.
Here's how to do it, specifically for this case and in general in general?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-11-07
@r1mple

All requests to urls starting with /api are sent by the web server to the back, and all the rest to the front.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question