UNPKG

@golemio/parkings

Version:
30 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isphkParkingRouter = exports.IsphkParkingRouter = void 0; const IsphkParkingController_1 = require("../controllers/IsphkParkingController"); const helpers_1 = require("@golemio/core/dist/input-gateway/helpers"); const express_1 = require("@golemio/core/dist/shared/express"); class IsphkParkingRouter { constructor(isphkParkingController) { this.isphkParkingController = isphkParkingController; this.initRoutes = () => { this.router.post("/measurements", (0, helpers_1.checkContentTypeMiddleware)(["application/json"]), this.postIsphkMeasurements); }; this.postIsphkMeasurements = async (req, res, next) => { try { await this.isphkParkingController.processData(req.body); res.sendStatus(204); } catch (err) { next(err); } }; this.router = (0, express_1.Router)(); this.initRoutes(); } } exports.IsphkParkingRouter = IsphkParkingRouter; const isphkParkingController = new IsphkParkingController_1.IsphkParkingController(); const isphkParkingRouter = new IsphkParkingRouter(isphkParkingController).router; exports.isphkParkingRouter = isphkParkingRouter; //# sourceMappingURL=IsphkParkingRouter.js.map