This updates to the latest stable node, which meant leaving behind geoip for geoip-lite, and time for moment-timezone.
The geoip-lite module is tricky to update using the commercial files - it requires hacking the .js file in the module to pull from a new URL (which ideally is a localhost URL using serve, which requires hacking it to use the http module instead of https...), and then symlinking into the node_modules dir for easier management of the resulting .dat files across deploys.
The moment-timezone module works differently than time. The time module helpfully just wrapped the built-in Date object and imbued it with timezone smartness. The moment-timezone module has its own objects and parsing/formatting rules. I had to be slightly hacky about assembling a string and serializing it and then parsing it and then having Date parse the outputted format from that...but it's at least all contained inside a tiny function in christmas.js.
This should be a seamless transition for the web app, and for the API that IFTTT consumes. I'll need to do some testing from within IFTTT to make sure it's bug-free.
This updates to the latest stable node, which meant leaving behind
geoip
forgeoip-lite
, andtime
formoment-timezone
.geoip-lite
module is tricky to update using the commercial files - it requires hacking the .js file in the module to pull from a new URL (which ideally is alocalhost
URL usingserve
, which requires hacking it to use thehttp
module instead ofhttps
...), and then symlinking into thenode_modules
dir for easier management of the resulting.dat
files across deploys.moment-timezone
module works differently thantime
. Thetime
module helpfully just wrapped the built-inDate
object and imbued it with timezone smartness. Themoment-timezone
module has its own objects and parsing/formatting rules. I had to be slightly hacky about assembling a string and serializing it and then parsing it and then havingDate
parse the outputted format from that...but it's at least all contained inside a tiny function inchristmas.js
.This should be a seamless transition for the web app, and for the API that IFTTT consumes. I'll need to do some testing from within IFTTT to make sure it's bug-free.