UNPKG

@golemio/pid

Version:
27 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RopidGtfsRouter = void 0; const CheckContentTypeMiddleware_1 = require("@golemio/core/dist/input-gateway/helpers/CheckContentTypeMiddleware"); const express_1 = require("@golemio/core/dist/shared/express"); const RopidGtfsController_1 = require("./RopidGtfsController"); class RopidGtfsRouter { constructor() { this.post = async (req, res, next) => { try { await this.controller.processData(req.body); res.sendStatus(204); } catch (err) { next(err); } }; this.router = (0, express_1.Router)(); this.controller = new RopidGtfsController_1.RopidGtfsController(); this.initRoutes(); } initRoutes() { this.router.post("/presets", (0, CheckContentTypeMiddleware_1.checkContentTypeMiddleware)(["application/json"]), this.post); } } exports.RopidGtfsRouter = RopidGtfsRouter; //# sourceMappingURL=RopidGtfsRouter.js.map