url rewriting - create stackoverflow like url for search in node.js and javascript -


i want change page's url search item stackoverflow , display page newly created url,every time hit url in new tab.

like if search using 'natures photography' retrieves photo named 'sunset in village' url should this: http://localhost:8080/sunset-in-a-village

how node.js / javascript?

if search using 'natures photography' retrieves photo named 'sunset in village'

what mean exactly? search return not 1 item.
suggest result set , have url /seach/natures-photography , 1 of finded item have url /photo/sunset-in-a-village

    app.get('/search/:query', function(req, res, next) {         // client send dashed , lowercase query         var query = req.params.query; // natures-photography         // render result page. each image have url /photo/:dashed-lowercase-name     })    ...     app.get('/photo/:name', function(req, res, next) {         var name = req.params.name; // sunset-in-a-village         name = name.replace('-', ' '); // remove dash name , find image original lowercase-name           // render chosen photo-page      }) 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -