diff --git a/controllers/pastes.js b/controllers/pastes.js index f8f92cb..9eeb236 100644 --- a/controllers/pastes.js +++ b/controllers/pastes.js @@ -101,6 +101,7 @@ module.exports = { const paste = new Paste({ paste: ctx.request.body.paste, + ip: ctx.request.ip, expiresAt: new Date(Date.now() + (ctx.request.body.expire * 1000)) }); diff --git a/models/paste.js b/models/paste.js index fabdd49..d5c533c 100644 --- a/models/paste.js +++ b/models/paste.js @@ -6,6 +6,7 @@ const nanoid = customAlphabet(dictionary.nolookalikes, 8); const paste = new mongoose.Schema({ _id: { type: String, default: nanoid }, paste: { type: String }, + ip: { type: String }, expiresAt: { type: Date, expires: 0 } }, { timestamps: true