r/FastAPI • • Dec 01 '21

Question How to deploy API that has REST and WebSocket? Help

Hello all, I am currently in the stage of deployment for my application. Right now the problem that I have is trying to deploy the API. How do I go about this, the API has REST and WebSockets combined. The method of deployment that I plan to use is with AWS's EC2 instances (The free instance at first just to try the application out).

0 Upvotes

4 comments sorted by

2

u/whattodo-whattodo Dec 01 '21

Have you tried googling 'FastAPI on EC2'?

There are many good tutorials covering exactly this...

1

u/Megalord_ Dec 01 '21

Yes but most only cover with Rest APIs not with Websocket

1

u/whattodo-whattodo Dec 01 '21

Possibly I'm just not understanding the question.

If you want to deploy FastAPI onto EC2 then those tutorials would help you do it. Once the API is deployed you would still need to build endpoints. Some (or all) of those endpoints can be websockets.

Are you having a hard time deploying FastAPI to EC2 or are you having a hard time building websocket endpoints in FastAPI?

0

u/Megalord_ Dec 02 '21

So what I am understanding here is that when I deploy the API. Websocket will just right of the bat without any major configurations?