Initial refactor (routes and utils to respective folders)

This commit is contained in:
Joe-Dowd
2020-03-19 23:20:33 +00:00
parent f6826b60b0
commit 5c3d18b0e2
18 changed files with 1094 additions and 982 deletions

6
src/utils/getIP.js Normal file
View File

@@ -0,0 +1,6 @@
var fs = require('fs');
var config = JSON.parse(fs.readFileSync('config.json'));
module.exports = function getIP(req) {
return config.behindProxy ? req.headers['x-forwarded-for'] : req.connection.remoteAddress;
}