add userCounter mocks and rearrange webhook path

This commit is contained in:
Michael C
2022-09-21 01:14:22 -04:00
parent 3f470a72f5
commit f683ed4f29
6 changed files with 35 additions and 15 deletions

View File

@@ -1,23 +1,24 @@
import express from "express";
import { config } from "../src/config";
import { Server } from "http";
import { UserCounter } from "./mocks/UserCounter";
const app = express();
app.post("/ReportChannelWebhook", (req, res) => {
app.post("/webhook/ReportChannel", (req, res) => {
res.sendStatus(200);
});
app.post("/FirstTimeSubmissionsWebhook", (req, res) => {
app.post("/webhook/FirstTimeSubmissions", (req, res) => {
res.sendStatus(200);
});
app.post("/CompletelyIncorrectReportWebhook", (req, res) => {
app.post("/webhook/CompletelyIncorrectReport", (req, res) => {
res.sendStatus(200);
});
// Testing NeuralBlock
app.post("/NeuralBlockRejectWebhook", (req, res) => {
app.post("/webhook/NeuralBlockReject", (req, res) => {
res.sendStatus(200);
});
@@ -47,6 +48,9 @@ app.post("/CustomWebhook", (req, res) => {
res.sendStatus(200);
});
// mocks
app.use("/UserCounter", UserCounter);
export function createMockServer(callback: () => void): Server {
return app.listen(config.mockPort, callback);
}