ways icon indicating copy to clipboard operation
ways copied to clipboard

feature request: "referer" property on the request object

Open hems opened this issue 11 years ago • 3 comments

Could we have a "referer" property on the request object so we could take decisions based on the previously rendered page?

Maybe this is somehow available somehow ?

hems avatar Mar 18 '14 20:03 hems

You can access the history object though the middleware, it's not exactly what you need but I think you can achieve what you want.

https://github.com/serpentem/ways-browser/blob/master/src/history.coffee#L4

Just pay attention, there are two scenarios for that, this last one (#hashurls) is simply an array: https://github.com/serpentem/ways-browser/blob/master/src/hash.coffee#L12

arboleya avatar Mar 19 '14 00:03 arboleya

var ways = require('ways'),
    browser = require('ways-browser');

ways.use(browser);
ways('*', function(){
    console.log(browser.history);
});

arboleya avatar Mar 19 '14 00:03 arboleya

cool! tks for pointing the hash thing out

hems avatar Mar 20 '14 02:03 hems