'use strict';

var path = require('path');
var talkIdValidator = require(path.join(__dirname, 'middleware', 'talkIdValidator'))();
var questionIdValidator = require(path.join(__dirname, 'middleware', 'questionIdValidator'))();
var questionInTalkValidator = require(path.join(__dirname, 'middleware', 'questionInTalkValidator'))();
var talkShortIdValidator = require(path.join(__dirname, 'middleware', 'talkShortIdValidator'))();
var questionShortIdValidator = require(path.join(__dirname, 'middleware', 'questionShortIdValidator'))();
var attendeeController = require(path.join(__dirname, '..', 'controllers', 'attendeeController'))();

module.exports = function (app) {
  app.get('/answer/:talkId/:questionId', talkIdValidator.validate, questionIdValidator.validate,
    questionInTalkValidator.validate, attendeeController.showAnswerQuestionForm);
  app.get('/a/:talkShortId/:questionShortId', talkShortIdValidator.validate, questionShortIdValidator.validate,
    questionInTalkValidator.validate, attendeeController.showAnswerQuestionForm);
};