import { Router, json as jsonMiddleware } from "express";
import TestResultsWorker from "../rabbit/workers/TestResultsWorker.js";

export default function buildDevRoute(pg, skio) {
  const router = Router();
  router.use(jsonMiddleware());
  router.post("/rabbit/TestResults", (req, res) => {
    const { testResult } = req.body;
    new TestResultsWorker(skio).onMessage(testResult);
    res.sendStatus(200);
  });
  return router;
}
