"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ropidGtfsRouter = 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");
const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
class RopidGtfsRouter extends AbstractRouter_1.AbstractRouter {
    constructor() {
        super("v1", "ropidgtfs");
        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;
const ropidGtfsRouter = new RopidGtfsRouter();
exports.ropidGtfsRouter = ropidGtfsRouter;
//# sourceMappingURL=RopidGtfsRouter.js.map