everything to postClearCache

This commit is contained in:
Michael C
2021-09-22 17:50:06 -04:00
parent 94e1e8c377
commit c779c2c19e
21 changed files with 750 additions and 860 deletions

View File

@@ -1,4 +1,4 @@
import fetch from "node-fetch";
import axios from "axios";
import {Logger} from "../utils/logger";
import {config} from "../config";
import {getIP} from "../utils/getIP";
@@ -6,7 +6,7 @@ import {getHash} from "../utils/getHash";
import {NextFunction, Request, Response} from "express";
export function userCounter(req: Request, res: Response, next: NextFunction): void {
fetch(`${config.userCounterURL}/api/v1/addIP?hashedIP=${getHash(getIP(req), 1)}`, {method: "POST"})
axios.post(`${config.userCounterURL}/api/v1/addIP?hashedIP=${getHash(getIP(req), 1)}`)
.catch(() => Logger.debug(`Failing to connect to user counter at: ${config.userCounterURL}`));
next();