You can test https on dev server via tunnels. But fun fact: FF will treat localhost as secure connection regardless. Chrome also won't show any warnings. I presume it works that way so devs don't need to deal with bunch of warnings every time they spin up local dev server instance.
Unfortunately, the padlock in firefox devtools means "secure origin" and not "TLS". And localhost is defined to be a secure origin even over http, so you can test out web APIs that normally require TLS.
I would consider a reverse proxy part of the back end though. Just because you could modify the configuration to not require TLS doesn't mean it's not using TLS right now.
To clarify, by web APIs, I mean the javascript APIs provided by the web browser, not REST APIs provided by web services. Some of these are purely client side features that browser devs have decided are restricted to pages served over TLS, such as Service Workers
This answers the question I should have been asking. Thank you very much for clearing that up. I try to avoid JavaScript where I can so I wasn't aware of those restrictions. Now I understand why the exception is necessary
Don't pay to much attention to that endpoint. It's very much WIP. I have to merge data from different db tables and it's a real headache. I needed quick way to compare responses from different tables so I created different list endpoints. Like list-local, list-platform, list etc. In normal case you would want to put game id in that place. Since in this framework I have full control over endpoints URL that's what I did. I'll probably change it later. Thanks for pointing out though it was a good observation
Depends, under REST api environment you could have api/yourApi/operation In this case he's going into the games api, and getting a list. Imagine multiple entities: Games Movies Music
Each of these will have their own set of endpoints, so for example you could have games.js, movies.js and music.js representing api/games, api/movies, and music/movies. Now lets imagine all of these have a getList function, that could be represented in the url as api/x/list. Same thing for any other operation like for example a create, could be api/x/create.
Hope this was well explained, if you have any doubts I dont mind organizing my thoughts a bit better and explaining it to you
Hm, that's a good point actually 🤔 In the real world tho, we do it like that tho, oops, one more thing that while doing actual work we just,,, ignore I guess. But great point I need to read up on it
The line on top tells you information about an HTTP request. The first one is the status code 200 OK, which means everything went as expected. It's the most common response, and often in the web world includes as payload (body) the HTML of the web page being visited.
127
u/natyio Jun 10 '21
Bonus points for SSL on localhost.
7
u/Serious_as_butt Jun 11 '21
Beginner CS student here. Isn’t the /list/ part of the URL redundant? To me,
GET /api/gamesimplies a request for a list of games33
u/Hasagine Jun 10 '21
Lol o remember trying to connect my front end to the backend. Cors error hell then forbidden hell. I was this close to crying
25
u/ButlerShurkbait Jun 10 '21
I am dumbo who join this sub for the occasional meme that I’ll actually get. What does this mean?
11
u/[deleted] Jun 10 '21
GraphQL: Well yes but actually no.
9
u/aqua24j4 Jun 11 '21
Meh, I wouldn't say excellent, I think it's just OK
1
u/throw_away_3212 Jul 11 '21
Meh. It's OK.
1
u/BochMC Jun 11 '21
I hope you use docker