In this implementation, the backend api is public by default? #1464
Unanswered
BobbyTumur
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
First of all, thank you for the project, I learned so much from it as this was my first web project I've worked on.
Now I am not sure of the best practices about web implementation but there is something inside tells me backend normally sits hidden from the public. Maybe because I hear a lot that "this" and "that" made their api public bla bla.
So far I have inspected docker networks, traefik logs, browser developer tools etc, what I've got was browser or curl was directly making a request to api.example.com, as it was confirmed on the traefik logs where there was no ip address of docker thats running frontend in between.
Tried deleting labels on the backend service and directly used the docker network on the frontend as:
frontend:
build:
context: ./frontend
args:
- VITE_API_URL=http://backend:8000
then the browser started yelling me it is not using HTTPS and hence the TLS/SSL certificate is served by traefik and also I am using HttpOnly Secure cookie on the refresh token, so using - VITE_API_URL=http://backend:8000 was not much of a help.
Is this normal for FastAPI&React combination to have a public api by default? or it's just a template after all that does things that way and there is shit tons other ways/workarounds to make api hidden.
Sorry if it's a noob question but if anyone has any thoughts/implementation, would be really appreciated if you answer.
Operating System
Linux
Operating System Details
Not relevant
Python Version
Not relevant
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions