RESTful Web Microservices #itp #understanding-networks

Oct 31, 2024

This week, I am experimenting with RESTful web microservices. I set up an nginx server block at https://api.jbd.lol. I wrote a Node.js script based on Tom Igoe’s NodeWithNginx to provide three microservices.

The first one is apps/date, which displays the current date on the server. I am using the figlet utility to convert the date text to ASCII art to make it a bit more fun.

The second one is apps/blog, which displays a random blog post of mine for understanding networks. If you refresh the page, it will show a randomly selected page each time.

The last one is apps/weather, which displays weather information of Brooklyn, NY. I am using OpenWeather’s API for showing the current weather.

In addition, I included the ability to use apps/weather?lat=xx.xx&lon=xx.xx to specify a specific latitude and longitude.