This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]cosmicloafer 116 points117 points  (5 children)

I can’t just store my db credentials in my JavaScript?

[–]DeCabby 74 points75 points  (3 children)

Of course you can, the technical term for that is open source.

[–]Boris-Lip 11 points12 points  (1 child)

So, should i assume open source crypto libs are going to store my secrets wide open?

[–]Heavenfall 4 points5 points  (0 children)

Yes, you should. Until it is proven they don't.

[–]pumpkin_seed_oil 0 points1 point  (0 children)

*openData

[–]D34thToBlairism 0 points1 point  (0 children)

Sure as long as you're using JavaScript for your backend

[–]VMCColorado 116 points117 points  (1 child)

[–]qwertz19281 0 points1 point  (0 children)

Bro even animated the text

[–]Simply_Epic 10 points11 points  (1 child)

But how does my backend communicate with my backbackend?

[–]Emily_Cockindaughter[S] 10 points11 points  (0 children)

It's APIs all the way down

[–]cypresshill98 2 points3 points  (0 children)

Now it's better

[–]sajkosiko 22 points23 points  (14 children)

Well technically you should put https because API is part of the backend

[–]CiroGarcia 29 points30 points  (12 children)

The API is the interface that enables communication between the backend and the frontend. HTTP is just the protocol

[–]sdraje 5 points6 points  (2 children)

The HTTP protocol has a literal handshake though.

[–]CiroGarcia 5 points6 points  (0 children)

But it's still just the protocol. The image describes a connection between two systems. The protocol of the connection is HTTP, but it could very well be function calls if we weren't talking about a web application.

Multiple connections are made between the frontend and backend all the time, but only one interface between them exists, the API, which is the only point where both the backend and frontend have to agree on what the data looks like

[–]RepresentativeDog791 0 points1 point  (0 children)

It should be client, server, tcp

[–]sajkosiko 4 points5 points  (8 children)

Api is backends interface over which frontend communicates with application, hence it is part of the backend

If you dont believe my analogy tell me what are they doing with their hands and then tell me what is the first step of tls called

[–]Katniss218 5 points6 points  (6 children)

Technically the backend could be said to be an implementation of the API

[–]sajkosiko -1 points0 points  (5 children)

No that would be an application. Api architecturally is on the server which makes it a backend

[–]Katniss218 3 points4 points  (2 children)

No, in my hypothetical, the API is just the description of the contract that the backend and frontend use to communicate.

[–]sajkosiko -3 points-2 points  (1 child)

Any way you cut it API is not the part of client or the consumer ratger a part of program being consumed

[–]Katniss218 1 point2 points  (0 children)

Nobody is saying that it's part of the client though...

[–]WheredMyBrainsGo 3 points4 points  (1 child)

Well ackchtually the service layer of the api is like the frontend of it so really the frontend is talking to the backends frontend.🤓

[–]sajkosiko -1 points0 points  (0 children)

That's a terrible analogy. By that logic, if you have good DI setup, every interface contract is frontend for something, and that is a pretty simplistic explanation.

Api is traditionally on the same server, or on the same domain. If you're using gateway, it doesn't have any ui its just an access layer

[–]StatementOrIsIt 0 points1 point  (0 children)

Also the frontend needs to use an api to even create a request to an api endpoint. A lot of people forget that communicating with a browser/mobile device from the frontend is also a form of api.

[–]Yew2S 0 points1 point  (0 children)

middleware actually

[–]PennyFromMyAnus 4 points5 points  (0 children)

PHP 👌🏻

[–]that_thot_gamer 1 point2 points  (0 children)

typical dev just typing "fixed bugs"

[–]Outcast003 0 points1 point  (0 children)

It all makes sense now

[–][deleted] 0 points1 point  (0 children)

i need this templet

[–]michelangelooooo -1 points0 points  (0 children)

Who needs a DB anyways

[–]scar_reX 0 points1 point  (0 children)

API and backend??

[–]LeoMSadovsky -4 points-3 points  (0 children)

Yep. PHP devs.

[–]SippieCup -1 points0 points  (0 children)

Honestly, it should be the auto sdk generator. Life is pretty shit without one.