Learning REST and creating a reverse proxy with NGINX

JC0133

Senior member
Nov 2, 2010
201
1
76
So I just started a internship and I have a project I need to do. Most of this is new to me so I am looking for some youtube or website tutorials and if there exist some examples of what I am trying to do.

Create a tool that tracks API service status
-Query and HTTP Call via rest. Receive and HTTP response code.

So I am supposed to create a tool that tracks API service status. I need to query a HTTP call via rest and get the response code.

My manager told me I need to learn 3 things that will help me with this.

1. I need to learn REST.
2. I should try and create a reverse proxy of NGINX(I need to learn NGINX)
3. I should find an OPEN API and try to connect to it.

I am still fairly new to software programming. If anyone can provide me with some you tube videos with examples of doing this or tutorials on learning how to do these steps I would appreciate it.
 

purbeast0

No Lifer
Sep 13, 2001
53,486
6,326
126
I really don't know why you would need #2 and #3 for what you said you need to do, which is make an http call and get the response code.
You also don't get into what "track api service status" means.

If I were you, I'd start with node.js with express. You can get a node.js server with express up and running in minutes, to the point where you can hit an endpoint in your browser and see the response.

Just google 'nodejs with express' and you will see a ton of tutorials. This was one of the first results.

https://medium.com/@LindaVivah/the-...-node-js-express-js-fundamentals-e15493462be1

It has a step by step guide of 5 steps on how to get a server up and running and how to hit it.
 
Feb 25, 2011
16,986
1,617
126
REST isn't a language or something you "learn" per se, it's more like a style of communication for special HTTP URLs on a server - you hit a certain URL with certain parameters and a certain payload, and get a bunch of (usually) XML or JSON back.

Anything that can create an HTTP request can interact with a RESTful API (so pretty much anything). There's a very simple one implemented here with pretty good documentation and examples.

https://vpic.nhtsa.dot.gov/api/

Instead of starting with node, I'd probably start simpler; Python and the "requests" library. https://stackoverflow.com/questions/17301938/making-a-request-to-a-restful-api-using-python

You'll need to figure out what API endpoints to hit to determine service status, and what the data you get back means. (You don't want a 404, but does a 404 mean it's up? Is that red, green, or yellow?) Once you get data to and from an API endpoint, then you gotta figure out what to do with it. Good luck.