Web Clock
Jump to navigation
Jump to search
The Web Clock was made primarily using JavaScript. The server-side API was rather simple, and it only used Nginx's built-in variable and response functionality to create a simple JSON response containing the current time, along with the remote (your) IP address and TCP port number, the latter of which will likely become a part of a "NAT type" checker utility that I will write in the near future.
location /time { default_type application/json; types { } return 200 "\{\"time\": $msec, \"remoteIP\": \"$remote_addr\", \"remotePort\": $remote_port\}"; }
https://apps-vm3.peterjin.org/time (example of above API implementation)
Full demo: https://webclock.peterjin.org/