This repo is my take on hello world for http4s. It's inspired by surfer, a tool written in Go that exposes Motorola SURFboard stats for Prometheus to scrape.
There are two http4s services... The first service serves static files scraped from a real modem to mock it for demo purposes. The fake modem can be started with:
sbt "run-main Modem"
Visit http://localhost:8080/index.htm to see the fake modem in "action". Pressing "enter" in the SBT terminal after the service is started will close it.
The second service is a proxy that waits for incoming requests, scrapes the fake modem to extract status details, and serves the status to the user as JSON. It can be started with:
sbt "run-main Proxy"
Typically, you will want to start it in a second SBT session in a new terminal window.
The JSON status is exposed at http://localhost:8090/api/status.