I am trying to design a simple website that will display weather data like temperature, pressure, wind speed and direction. I have a working API that I developed by following along with the video series below.
It is based on FastAPI and works fine. I would like to design a simple front end using just the base building blocks of html, css and javascript. I took a 6 month coding class and have a decent base of knowledge in those languages. At least enough to create something with which I would be content.
My question is how do I go about simply allowing the front end to interact with the back end. The API will be receiving live weather data from a weather station I built myself. There is both a put and get capability of the API.
Can I simply write a website that is accessed via something like apache on the normal ports 80 and 443 and have the webpage itself get the data from the API running on the same machine. The API would be running on a port of my choosing and the webpage would make API requests to localhost:xxxx.
I am not concerned about security at this point. I just want to know if the concept will work or if not, what is the best way to accomplish my goal. I am entirely self taught so I apologize for not framing my questions with the appropriate lingo. I am doing my best.