This describes a small redirect service and QR strategy that sends a single printed URL to the correct destination: App Store for iOS, Play Store for Android, or the website for everything else. The QR uses a short host (go.pokernexus.com/app) and a browser-generated SVG so printed codes remain scannable; the server is a tiny Hono app whose routing entries map paths to Destinations (url plus a query-handling flag: "forward" or "drop"). /app calls a storeFor function that inspects User-Agent with regexes to classify bots first, then iOS and Android, falling back to the website. This keeps misclassifications safe (a wrong website is better than forcing an incompatible store install) and keeps the QR permanently repointable.
Practical edge cases are handled explicitly: crawlers are detected before device sniffing to avoid cloaking; iPad Safari’s Mac-like UA is accepted as a website fallback instead of an invasive JS interstitial; redirects use 302 and set Vary: User-Agent so caches don’t freeze a device-specific answer; HEAD is supported for link checkers. Query strings forward to the website but are dropped for stores (Play’s id param must not be overwritten). The shortlink host intentionally isn’t claimed by mobile app link entitlements so installed apps won’t intercept it. Tests use real user agents and assert package/app IDs match the client code.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.