javascript - Not getting the right URL path - URL path is: /favicon.ico -


im using following code , when run path in browser first time http://localhost:9000/aaaa/bbbb/cccc

in first time im getting /aaaa/bbb/cccc in second got url path is: /favicon.ico

what can overcome issue?

 url = require('url'); ....     http.createserver(function(req, res) {         var hostname = req.headers.host.split(":")[0];         var pathname = url.parse(req.url).pathname;          console.log("host name: " + hostname);         console.log("url path is: " + pathname); 

  1. if have nginx in front of node, add location = /favicon.ico { access_log off; log_not_found off; } conf.
  2. serve node

    if (req.url === '/favicon.ico') {     res.writehead(200, {'content-type': 'image/x-icon'} );     return res.end(); } 
  3. go linking favicon html quentin suggested.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -