superfly / edge

A set of useful libraries for Edge Apps. Run locally, write tests, and integrate it into your deployment process. Move fast and maybe don't break things? Because, gosh darnit, you're an adult.
https://fly.io
Apache License 2.0
143 stars 10 forks source link

device routing/mobile deep link middleware #39

Open barnese3 opened 5 years ago

barnese3 commented 5 years ago

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.

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 )