edge
edge copied to clipboard
device routing/mobile deep link middleware
Middleware: Uses https://github.com/faisalman/ua-parser-js to parse the user-agent header from requests. Then, checks the user's device and operating system. Then, adds Fly-Device-Type and Fly-Device-OS headers to the request.
- If mobile && iOS, response will be an App Store app page
- If mobile && Android, response will be a Play Store app page
- If user is not on a mobile device, the original response will be served (desktop version of site)
Also, had to add queryStringParameters to src/proxy.ts and src/backends/origin.ts for the query string parameters on mobile && Android's origin URL to pass through in the request
-- Deployed at https://mobile-deep-link.edgeapp.net/
( fixes #5 )