-
Notifications
You must be signed in to change notification settings - Fork 0
/
router.js
28 lines (23 loc) · 1012 Bytes
/
router.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const _ = require('underscore');
const utils = require('./include/utilities');
const moment = require('moment-timezone');
module.exports = () => {
if (process.env.NODE_ENV == 'development') {
global.app.get('/123', (req, res, next) => {
res.status(200).send({ message: 'Hello World', });
}, (error) => {
res.status(500).send({ message: 'Sorry Bro!!', });
});
}
var clientsiteFootPrint = async(req) => {
var payload = {
agent: await utils.getUserDeviceDetails(req.headers['user-agent']),
ipAddressDetails: await utils.getUserIpDetails(req.headers['x-forwarded-for'] ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||
(req.connection.socket ? req.connection.socket.remoteAddress : null)),
createdTime: moment().toDate('YYYY-MM-DD HH:mm:ss'),
};
var docInserted = await utils.insertDocInDb('clientFootPrint', payload);
}
};