For this assignment, the idea was to create a simple server, similar to the class examples, with 3 different functions or restfull Apis. I looked at different example by Tom Igoe and some by Shawn Van Every. It made me a bit more familiarized with the code language used for this purpose, even if I still don’t understand some parts of the code of the more complex examples. So I chose the example of the “age checker” by Tom Igoe, to built my aplication around it (This, after a great deal of anxiety and confussion about how to get started).
So what I managed to do was simple but allowed me to
The functions for the server I wrote are 3:
- Selecting a color in terms of text.
- Changing the color of the background.
- Loading an image to the background. (still
does’twork 🙁 )
- The first asks you to put a color input by typing a)http://localhost:8080/check/color/red or b)http://localhost:8080/check/color/green, http://localhost:8080/check/color/blue, c)http://localhost:8080/check/color/(or something else). There is a bug I haven’t figured out when I enter blue. It doesn’t show a text message it’s supposed to show.
- The second is for you to change the browser’s background. You enter a)http://localhost:8080/check/imageBackground/:imageBackground/change b)http://localhost:8080/check/imageBackground/:imageBackground/(something-else-other-than-change
- The third function is for uploading an image. By entering the word image, an image will be loaded in the browser.
The first two work, but the third, It still doesn’t at this point.
The code at this point, without the image load function working properly for the mean time: