[erlang-questions] cowboy: dispatch on chrome/firefox vs android/iphone
Mon Apr 14 10:58:50 CEST 2014
Browser sniffing is considered bad in general and very bad today with so
many variations of browser headers.
Maybe you can change the a bit the approach and first load a page that
detects browser capabilities with JS (like a 'loading..' page) and makes a
second call for the right template.
On 13 April 2014 07:09, Barco You <> wrote:
> No. I think you have to parse the HTTP Header by yourself and then return
> corresponding body as "desktop.html" or "mobile.html"
> On Sat, Apr 12, 2014 at 8:48 AM, t x <> wrote:
>> Using cowboy, is there a easy way to, for:
>> mysite.com/ serve
>> * ~/static/desktop.html if browser = chrome/firefox
>> * ~/static/mobile.html if browser = android/iphone ?
>> (Sample code to steal would be ideal; though functions to lookup
>> suffices too.)
>> erlang-questions mailing list
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions