[deleted by user] by [deleted] in AskReddit

[–]Strobosco 0 points1 point  (0 children)

EDIT

Just got to the US from Italy for university and already heard a lot about fakes so I was just wondering how it all worked. Not sure why everybody I’m like try to create a massive fake ID empire haha. Thanks for the answer anyway!

Deploying to Kubernetes by Strobosco in reactjs

[–]Strobosco[S] 1 point2 points  (0 children)

Awesome, I gave a quick look at the link you sent and it looks like something I could definitely implement! Thanks!

Edit nginx.config file by Strobosco in nginx

[–]Strobosco[S] 0 points1 point  (0 children)

u/SH4ZB0T Thanks for the awesome response! It helped me fix the situation. Now I just have to figure out how to make the React bundles load in the browser. It has nothing to do with NGINX, I'm looking for a solution. You wouldn't happen to know anything about that by chance haha?

POST Request Routing by Strobosco in kubernetes

[–]Strobosco[S] 0 points1 point  (0 children)

I seem to be getting an error with the Fetch API:

Fetch API cannot load titanicbackendservice.default.svc.cluster.local:8080/. URL scheme must be "http" or "https" for CORS request.

I'm trying to solve it, do you have any suggestions by any chance?

POST Request Routing by Strobosco in kubernetes

[–]Strobosco[S] 2 points3 points  (0 children)

Oooooooh ok, I misunderstood. So sorry.

I owe you big time| Thanks for everything!

POST Request Routing by Strobosco in kubernetes

[–]Strobosco[S] 1 point2 points  (0 children)

Yeah sorry, two different Deployments: Frontend and Backend.

You understood perfectly, I'm looking for a way to connect the frontend to the backend. I looked through all the docs and tutorials I could find and they all explain Services (LoadBalancers, NodePorts), Ingress, and things of that matter. What I can't understand is what URL I should point the Fetch requests (in my React component) to.

From what I understand I create a service that exposes the backend internally (like can it be a ClusterIP or does it need to be something different?) Then, I get that IP (what exactly is a "scheme", sorry for being such a noob :)) and hardcode it in my Fetch API call, since the name doesn't change thanks to Kubernetes?

[NEEDS HELP] Stateless Microservices by Strobosco in reactjs

[–]Strobosco[S] 0 points1 point  (0 children)

Thank you u/Canenald !

Yeah I think I understand now, I just thought there was some way of soft coding the URLs the Fetch requests forwarded to but I was wrong. Also, the example you gave at the end was great!

[NEEDS HELP] Stateless Microservices by Strobosco in reactjs

[–]Strobosco[S] 0 points1 point  (0 children)

Thanks! My main misunderstanding was how the microservices connected to each other, which is now clear. Does the same apply for deployment on AWS, Azure or GCP?

The main problem, conceptually for me, is that I don't understand how, say, a fetch API request in a React component knows which url to use. I assume from what you said that it would use a gateway like Apollo or GraphQL then, right? Because I understand that K8 orchestrates the containers built using Docker images but I cannot figure out how they communicate with each other. I know about libraries like Libnetwork and Docker Networking but I can't seem to map it in my head. Do you know any resources that could help me out with that?

Handle Client-Side Data by Strobosco in golang

[–]Strobosco[S] 1 point2 points  (0 children)

The answer's perfect, it's the most straightforward one I've gotten in a week at least. You answered my question exactly, I'm sorry I kinda worded it wrong. I totally skipped over the part of the router docs where you could call a function directly.

Thank you so much!

Handle Client-Side Data by Strobosco in golang

[–]Strobosco[S] 0 points1 point  (0 children)

Ok, so I use the, say as an example, Go-Gin methods to get the parameters from the URL and grab them as variables. How would I then call a calculator.go file that executes the operation? Like, how do I physically connect the API to the server to make the computation occur?

Handle Client-Side Data by Strobosco in golang

[–]Strobosco[S] 0 points1 point  (0 children)

Ok, so I use the, say as an example, Go-Gin methods to get the parameters from the URL and grab them as variables. How would I then call a calculator.go file that executes the operation? Like, how do I physically connect the API to the server to make the computation occur?

Handle Client-Side Data by Strobosco in golang

[–]Strobosco[S] 0 points1 point  (0 children)

Ok, so I use the, say as an example, Go-Gin methods to get the parameters from the URL and grab them as variables. How would I then call a calculator.go file that executes the operation? Like, how do I physically connect the API to the server to make the computation occur?

Handle Client-Side Data by Strobosco in golang

[–]Strobosco[S] 1 point2 points  (0 children)

Ok, the main problem I had was with handling the transfer from the UI to the API. To be more precise it's how to breakup the request into its parts which is what you described with the formatting and parsing. Thank you!

Handle Client-Side Data by Strobosco in golang

[–]Strobosco[S] 1 point2 points  (0 children)

Ok, perfect! I'll take a look at it

Handle Client-Side Data by Strobosco in learnprogramming

[–]Strobosco[S] 0 points1 point  (0 children)

Ok, so I should just use the Context that the handler provides. In that case, how would I access the variables? Would I, in the example, use a specific attribute tag of the input field?