Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {spawn} from 'child_process';
import httpModule from 'http';
import config from 'config';
import express from 'express';
import prettyTime from 'pretty-time';
import LRU from 'lru-cache';
import iplocationModule from 'iplocation';
import EventSource from 'eventsource';
import isIp from 'is-ip';
import socketIO from 'socket.io';
import knex from './db/connection.js';
const iplocation = iplocationModule.default;
const expressPort = config.get('port');
const app = express();
const http = httpModule.Server(app); // eslint-disable-line new-cap
const io = socketIO(http, {path: '/globe/socket.io'});
const IPAPIKey = config.get('IPAPIKey');
const ipAPIURL = `https://api.ipstack.com/*?access_key=${IPAPIKey}`;
const wikimediaStreamURL = 'https://stream.wikimedia.org/v2/stream/recentchange';
const locationCache = new LRU(5000);
const maxDBItems = config.get('maxDBItems');
const stats = {