keystonejs/keystone-classic
Provide hostname etc from request to schemaplugins and hooks
開放
#3,187 建立於 2016年7月21日
help wantedneeds input
倉庫指標
- 星標
- (14,656 顆星)
- PR 合併指標
- (PR 指標待抓取)
描述
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