0

Hi I'm new to Cordova aka PhoneGap. I already made an express.js website and trying to build ios and android app using Cordova.

thus, there is one website. and there are 3 way(ios app, android app and web browser) to approach that.

I want to figure out what approach is and provide different layout in express routes.

In http header android device sent 'x-requested-with': 'com.example.hello' but iOS does not. In client js can use loacation.href but in express.js cannot read the location.href.

Is there any way to figure out the type of approach in express.js?

daniula
  • 6,898
  • 4
  • 32
  • 49
Eun Bit Hwang
  • 151
  • 1
  • 9

2 Answers2

0
app.get('/', function(req, res){
  // console.log(req.headers);
  console.log('User-Agent: ' + req.headers['user-agent']);
});
Gilberto Avalos
  • 502
  • 3
  • 7
-2

try this jxcore , it might be useful to your project !! ^_^

[https://www.sitepoint.com/how-to-run-node-js-with-express-on-mobile-devices/]

  • 1
    Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bhargav Rao Oct 02 '16 at 15:30