Closed maxoux closed 8 years ago
Hi ! Express can return (with req.ip) ::ffff:127.0.0.1 (or other ipv4 address translated), but it's appear to be invalid with Offshore. ex:
/// module BannedModule { var time_banned = 3600; class Class { attributes: Object; constructor(attr: Object) { this.attributes = attr; } beforeCreate(values, cb: Function) { var expires = (new Date().getTime()) + (time_banned * 1000); values.expires = new Date(expires); } } export var model= new Class({ ip: { ip: true, required: true, unique: true }, reason: { type: "string" }, expires: { type: "datetime" } }); } module.exports = BannedModule.model; Banned.create({ip: req.ip, reason: "weird guy"}).then(console.log).catch(console.log)
///
module BannedModule {
var time_banned = 3600;
class Class {
attributes: Object; constructor(attr: Object) { this.attributes = attr; } beforeCreate(values, cb: Function) { var expires = (new Date().getTime()) + (time_banned * 1000); values.expires = new Date(expires); }
}
export var model= new Class({
ip: { ip: true, required: true, unique: true }, reason: { type: "string" }, expires: { type: "datetime" }
});
module.exports = BannedModule.model;
Banned.create({ip: req.ip, reason: "weird guy"}).then(console.log).catch(console.log)
ps : sorry for bad style markdown and poor english
Hi, Express is a framework, offshore is an orm... you should integrate offshore in Express to do what you need...
Hi ! Express can return (with req.ip) ::ffff:127.0.0.1 (or other ipv4 address translated), but it's appear to be invalid with Offshore. ex:
ps : sorry for bad style markdown and poor english