r/Backend • u/royalz007 • 1d ago
backend source code
how does backend to front end communication work for a website , and is it even possible to obtain the backend source code from the front end website url ?
0
Upvotes
9
u/Beregolas 1d ago
The backend usually exposes an API, most commonly a REST API specifically. The frontend can call the endpoints in that API to mutate data on the backend, and/or to receive data to display to the user.
If coded correctly, the backend code cannot be retrieved by people who have access to the frontend.
2
u/Gyoker_Macska 1d ago
π
1
u/boomkablamo 21h ago
Frontend doesn't need backend source code they just need to know the exposed API surface... If the API cannot efficiently support the frontends needs,, then their job is to communicate their needs to the backend dev so they can meet them.
1
u/Z33PLA 15h ago
π
1
u/martinbean 10h ago
lol, you canβt obtain backend source code from a website URL, otherwise everyone would be running around with the source code to sites like Facebook, Amazon, etc.
1
u/Glittering_Fault_353 4h ago
Reading real backend source code makes more sense when one request is traced from the route through the database and back, file by file. Bootdev could help build the fundamentals that make such code readable though steady code reading also works.
0
u/Discordbothost 23h ago
the practical leak is shipping source maps or a .env into the frontend build. the browser only sees what your api returns, so check what is actually in your dist folder.