squidwarddab1111
squidwarddab1111
RRailway
Created by squidwarddab1111 on 7/31/2023 in #✋|help
Exposing FastAPI
Thanks all on the clarification. It helped me and I really appreciate it 🙇‍♂️
17 replies
RRailway
Created by squidwarddab1111 on 7/31/2023 in #✋|help
Exposing FastAPI
So once I've set the PORT env variable, would I be able to make api call without any further changes Say if I have a GET "/message/" endpoint that returns a text. If I fire a GET request from Insomnia or Postman to {service-name}-production-up.railway.app/message/, would that be it?
17 replies
RRailway
Created by squidwarddab1111 on 7/31/2023 in #✋|help
Exposing FastAPI
In your uvicorn.run() function instead of specifying 9000 as the port use os.getenv(“PORT”) That should solve it for you
Ah ok thank you very much
17 replies
RRailway
Created by squidwarddab1111 on 7/31/2023 in #✋|help
Exposing FastAPI
Hi Vin, thanks for getting on so quickly. By that do you mean I need to create a new environment variable named "PORT" and set the value to 9000? I can see that this is mentioned in the docs https://docs.railway.app/deploy/exposing-your-app, but Im kinda new to networking bits
17 replies
RRailway
Created by squidwarddab1111 on 7/27/2023 in #✋|help
Private networking - React and FastAPI
Ok will do. That is all the questions I have right now. Once again, thank you very much for the speedy response
11 replies
RRailway
Created by squidwarddab1111 on 7/27/2023 in #✋|help
Private networking - React and FastAPI
Ah ok thanks Brody, not a problem on backend being public. Question, is there a built-in way to allow my backend service to filter out requests that are not coming from my React app?
11 replies
RRailway
Created by squidwarddab1111 on 7/27/2023 in #✋|help
Private networking - React and FastAPI
Yes it is
11 replies