keystonejs/keystone-classic
Vedi su GitHubProvide hostname etc from request to schemaplugins and hooks
Open
#3187 aperta il 21 lug 2016
help wantedneeds input
Metriche repository
- Star
- (14.656 star)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
I need to write a mongoose plugin. where I need a Request object to find hostname.
module.exports = exports = function(schema, options) {
schema.add({
hostname: String
})
schema.pre('save', true, function(next, done) {
this.hostname = req.headers.host; //need request object
next();
setTimeout(done, 100);
});
}
I have raised related question in stackoverflow