2022-07-07 21:45:38 +00:00
|
|
|
import { Router, json as jsonMiddleware } from "express";
|
|
|
|
import TestResultsWorker from "../rabbit/workers/TestResultsWorker.js";
|
|
|
|
|
2022-07-12 21:26:36 +00:00
|
|
|
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;
|
|
|
|
}
|